-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (76 loc) · 2.2 KB
/
build-iac-arm-from-bicep.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build IaC - Azure ARM Template from Bicep
on:
push:
branches: [ main ]
paths:
- 'IaC/Bicep/**'
workflow_dispatch:
jobs:
terraform-v1:
name: 'Validate Bicep - v1'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bicep
uses: anthony-c-martin/setup-bicep@v0.1
- name: Bicep Build
run: |
bicep build deploy.bicep
working-directory: IaC/Bicep/v1
- name: Ensure v1 Folder Exists
run: |
if [ ! -d "IaC/ARM" ]; then
mkdir "IaC/ARM"
fi
if [ ! -d "IaC/ARM/v1" ]; then
mkdir "IaC/ARM/v1"
fi
- name: Move ARM Template
run: |
cp IaC/Bicep/v1/deploy.json IaC/ARM/v1/azuredeploy.json
rm IaC/Bicep/v1/deploy.json
cat IaC/ARM/v1/azuredeploy.json
- name: Commit to Repo
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: main # The branch the action should deploy to.
FOLDER: ${{ github.workspace }} # The folder the action should deploy.
terraform-v2:
name: 'Validate Bicep - v2'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bicep
uses: anthony-c-martin/setup-bicep@v0.1
- name: Bicep Build
run: |
bicep build deploy.bicep
working-directory: IaC/Bicep/v2
- name: Ensure v2 Folder Exists
run: |
if [ ! -d "IaC/ARM" ]; then
mkdir "IaC/ARM"
fi
if [ ! -d "IaC/ARM/v2" ]; then
mkdir "IaC/ARM/v2"
fi
- name: Move ARM Template
run: |
cp IaC/Bicep/v2/deploy.json IaC/ARM/v2/azuredeploy.json
rm IaC/Bicep/v2/deploy.json
cat IaC/ARM/v2/azuredeploy.json
- name: Commit to Repo
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: main # The branch the action should deploy to.
FOLDER: ${{ github.workspace }} # The folder the action should deploy.