From 3fc2807f0311f83a5caaf388a7408ed841ad872f Mon Sep 17 00:00:00 2001 From: Yuta Matsumura Date: Mon, 1 Jul 2024 23:58:02 +0900 Subject: [PATCH] chore: Update Azure Bicep deployment workflow --- .github/workflows/azure-bicep.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-bicep.yml b/.github/workflows/azure-bicep.yml index a08e529..68c5083 100644 --- a/.github/workflows/azure-bicep.yml +++ b/.github/workflows/azure-bicep.yml @@ -3,6 +3,12 @@ name: Azure Bicep on: workflow_dispatch: + inputs: + delete-group: + description: 'Delete resource group after deployment' + required: false + default: false + type: boolean permissions: id-token: write @@ -12,9 +18,6 @@ jobs: deploy-bicep: runs-on: ubuntu-latest environment: Production - defaults: - run: - working-directory: 'bicep' steps: - uses: actions/checkout@v4 @@ -37,9 +40,14 @@ jobs: with: subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} resourceGroupName: ${{ steps.resourceGroup.outputs.group-name }} - template: ./main.bicep + template: ./bicep/main.bicep parameters: 'storagePrefix=yuta storageSKU=Standard_LRS' failOnStdErr: false + - name: Delete resource group + if: ${{ github.event.inputs.delete-group }} + run: | + az group delete --name ${{ steps.resourceGroup.outputs.group-name }} --yes --no-wait + - name: Az CLI Logout run: az logout