Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/bicep.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion modules/storage.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Loading