forked from Azure/ARO-HCP
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.7 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
55
56
---
name: Bicep What If
on:
pull_request:
branches:
- main
paths:
- 'dev-infrastructure/**/*.bicep'
- '.github/workflows/bicep-what-if.yml'
- '.github/workflows/build-dev-infra.yml'
jobs:
what-if:
permissions:
id-token: 'write'
contents: 'read'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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="aro-hcp-dev"
cd dev-infrastructure/
az group create -g "${RESOURCEGROUP}" -l eastus --tags persist=true
# dev acr
az deployment group what-if \
--name "${GITHUB_RUN_ID}" \
--resource-group "${RESOURCEGROUP}" \
--template-file templates/dev-acr.bicep \
--parameters configurations/dev-acr.bicepparam
# 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}" \
--parameters maestroInfraResourceGroup="${RESOURCEGROUP}" \
--parameters persist="true"