From 7249d2a4ea8dc3bae51a7ed24d044f41570d11a1 Mon Sep 17 00:00:00 2001 From: Halyna Romanyshyn <30292604+halyna1995@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:28:30 +0200 Subject: [PATCH 1/2] Add GitHub Actions workflow for Bicep deployments This workflow defines two jobs: 'what-if' for previewing deployments on pull requests and 'deploy' for applying deployments on pushes to the main branch. --- .github/workflows/bicep.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/bicep.yml diff --git a/.github/workflows/bicep.yml b/.github/workflows/bicep.yml new file mode 100644 index 0000000..08b51c6 --- /dev/null +++ b/.github/workflows/bicep.yml @@ -0,0 +1,44 @@ +name: Bicep + +on: + pull_request: + push: + branches: ["main"] + +env: + CLASS_RG: rg-hyf-students + +jobs: + what-if: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: azure/login@v2 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Preview deployment + run: | + az deployment group what-if \ + --resource-group "$CLASS_RG" \ + --template-file main.bicep \ + --parameters \ + storageName=sthyfyourname \ + dbAdminPassword=not-a-real-secret + + deploy: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: azure/login@v2 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Apply deployment + run: | + az deployment group create \ + --resource-group "$CLASS_RG" \ + --template-file main.bicep \ + --parameters \ + storageName=sthyfyourname \ + dbAdminPassword=not-a-real-secret From e0726715bbb558cb727a142f840182b3b110c1ab Mon Sep 17 00:00:00 2001 From: Halyna Romanyshyn <30292604+halyna1995@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:43:30 +0200 Subject: [PATCH 2/2] Test Bicep what-if on pull request --- modules/storage.bicep | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/storage.bicep b/modules/storage.bicep index 34ac8e8..e2b615a 100644 --- a/modules/storage.bicep +++ b/modules/storage.bicep @@ -9,7 +9,15 @@ param containerName string = 'raw' resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { name: storageName location: location - sku: { name: 'Standard_LRS' } + + tags: { + environment: 'training' + } + + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' }