-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (57 loc) · 1.6 KB
/
bicepBuild.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
# Builds a JSON file from the main.json bicep
name: BicepBuild
on:
push:
branches:
#- 'master'
- 'dev'
paths:
- 'bicep/*'
- ".github/workflows/bicepBuild.yml"
#Run when PR's are made to master, where the changes are in the bicep directory or this workflow file itself
# pull_request:
# branches:
# - 'master'
# paths:
# - "bicep/*"
# - ".github/workflows/bicepBuild.yml"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: CheckGitHubEvent
shell: pwsh
run: |
echo 'ghen : ${{ github.event_name }}'
ls -la
- name: Install Bicep
shell: pwsh
run: |
az bicep install
- name: Bicep build
shell: pwsh
run: |
$buildPath = Join-Path -Path $pwd -ChildPath "ARM"
$biceps = Get-ChildItem bicep/*.bicep
write-output $buildPath
If(!(test-path $buildPath))
{
New-Item -ItemType Directory -Force -Path $buildPath
}
foreach ($bicep in $biceps) {
Write-Output "Building Bicep file: $bicep"
/home/runner/.azure/bin/bicep build $bicep.FullName --outdir $buildPath
}
Copy-Item bicep/*.parameters.* ARM -Force
Copy-Item bicep/uiFormDefinition.json ARM -Force
- name: ContextCheck
shell: pwsh
run: |
cd ARM
ls -la
- name: GIT Push Json file
uses: actions-x/commit@v6
with:
message: Adding auto compiled bicep json