Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions workflow for Azure Bicep deployment #15

Merged
merged 1 commit into from
Feb 1, 2025
Merged
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
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