Add GitHub Actions workflow for Azure Bicep deployment (#15) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Azure Bicep Deployment | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
resource_group: | |
description: 'Azure Resource Group' | |
required: true | |
default: 'rg-bice-deployment' | |
location: | |
description: 'Azure Region' | |
required: true | |
default: 'australiaeast' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
LOCATION: ${{ github.event.inputs.location || 'australiaeast' }} | |
RESOURCE_GROUP: ${{ github.event.inputs.resource_group || 'rg-bice-deployment' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Login to Azure using OIDC | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
allow-no-subscriptions: true | |
enable-AzPSSession: true | |
- name: Deploy Infrastructure using Bicep | |
run: | | |
az group create -l $LOCATION -n $RESOURCE_GROUP | |
az deployment group create -f ./main.bicep -g $RESOURCE_GROUP |