Skip to content

Commit f811b94

Browse files
Merge pull request #7 from workcontrolgit/develop
Add manual workflow to deploy Bicep infrastructure
2 parents 7c3d7b2 + db47acc commit f811b94

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/deploy-infra.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Azure Infrastructure (Bicep)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Target environment'
8+
required: true
9+
default: 'dev'
10+
type: choice
11+
options:
12+
- dev
13+
14+
permissions:
15+
id-token: write # Required for OIDC token request
16+
contents: read
17+
18+
env:
19+
RESOURCE_GROUP: 'rg-talent-dev'
20+
BICEP_FILE: 'infra/main.bicep'
21+
PARAMS_FILE: 'infra/parameters/dev.bicepparam'
22+
23+
jobs:
24+
deploy-infrastructure:
25+
name: Deploy Bicep Infrastructure
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Log in to Azure
33+
uses: azure/login@v2
34+
with:
35+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
36+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
37+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
38+
39+
- name: Deploy Bicep
40+
env:
41+
SQL_PASSWORD: ${{ secrets.SQL_ADMIN_PASSWORD }}
42+
run: |
43+
az deployment group create \
44+
--resource-group ${{ env.RESOURCE_GROUP }} \
45+
--template-file ${{ env.BICEP_FILE }} \
46+
--parameters ${{ env.PARAMS_FILE }} \
47+
--parameters sqlAdminPassword="$SQL_PASSWORD" \
48+
--output json

0 commit comments

Comments
 (0)