Skip to content

Commit

Permalink
Add GitHub Actions workflow for Azure Bicep deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
segraef committed Feb 1, 2025
1 parent b508cab commit b630e27
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/bicep_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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

0 comments on commit b630e27

Please sign in to comment.