Skip to content

Commit

Permalink
Create build-iac-arm-from-bicep.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
crpietschmann committed Mar 12, 2024
1 parent d769553 commit bf86c19
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build-iac-arm-from-bicep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build IaC - Azure ARM Template from Bicep

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read

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
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

0 comments on commit bf86c19

Please sign in to comment.