forked from Azure/ARO-HCP
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.53 KB
/
bicep-what-if.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
name: Bicep What If
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'dev-infrastructure/**/*.bicep'
jobs:
test:
permissions:
id-token: 'write'
contents: 'read'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 1
- name: 'Az CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Deployment What If'
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
RESOURCEGROUP=$GITHUB_RUN_ID
cd dev-infrastructure/
# service cluster
az deployment group what-if \
--name "${GITHUB_RUN_ID}" \
--resource-group "${RESOURCEGROUP}" \
--template-file templates/svc-cluster.bicep \
--parameters configurations/svc-cluster.bicepparam \
--parameters currentUserId="${GITHUB_ACTOR}"
# management cluster
az deployment group what-if \
--name "${GITHUB_RUN_ID}" \
--resource-group "${RESOURCEGROUP}" \
--template-file templates/mgmt-cluster.bicep \
--parameters configurations/mgmt-cluster.bicepparam \
--parameters currentUserId="${GITHUB_ACTOR}"