Skip to content

Update sample dependencies (#633) #84

Update sample dependencies (#633)

Update sample dependencies (#633) #84

Workflow file for this run

name: Publish
on:
push:
tags: [ v* ]
env:
DOTNET_VERSION: 6.0.x
BICEP_VERSION: 0.19.5
jobs:
publish:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.setup_version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use .NET Core ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Version
id: setup_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
- name: Publish Functions
run: dotnet publish -c Release -r win-x86 --self-contained false -o ./dist -p:Version=${{ steps.setup_version.outputs.version }} KeyVault.Acmebot
- name: Zip Functions
run: 7z a -mx=9 latest.zip ./dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: |
latest.zip
azuredeploy.bicep
deploy:
environment: production
needs: publish
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Use Bicep ${{ env.BICEP_VERSION }}
run: |
az config set bicep.use_binary_from_path=false
az bicep install --version v${{ env.BICEP_VERSION }}
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
- name: Upload to Blob
run: |
az storage blob upload --auth-mode login -f latest.zip --account-name stacmebotprod -c keyvault-acmebot -n v4/latest.zip --overwrite
az storage blob upload --auth-mode login -f latest.zip --account-name stacmebotprod -c keyvault-acmebot -n v4/${{ needs.publish.outputs.version }}.zip --overwrite
- name: Publish to Private Registry
run: |
az bicep publish --file azuredeploy.bicep --target br:cracmebotprod.azurecr.io/bicep/modules/keyvault-acmebot:v4 --force
az bicep publish --file azuredeploy.bicep --target br:cracmebotprod.azurecr.io/bicep/modules/keyvault-acmebot:v${{ needs.publish.outputs.version }} --force