-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (57 loc) · 1.93 KB
/
generate-arm-template.yml
File metadata and controls
70 lines (57 loc) · 1.93 KB
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
name: Generate ARM template & Add button
on:
workflow_dispatch:
push:
branches:
- v3
paths:
- iac/**
jobs:
generate-arm-template:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- name: Bicep Build
uses: Azure/bicep-build-action@v1.0.1
with:
bicepFilePath: 'iac/azuredeploy.bicep'
outputFilePath: 'iac/azuredeploy.json'
- name: push-update
run: |
ls -R
git config --global user.name 'Gitub Action Bot'
git config --global user.email 'wilfried.woivre@users.noreply.github.com'
git add .
git diff --quiet && git diff --staged --quiet || git commit -am "Add Azure ARM template"
git pull --rebase
git push
add-azure-deploy-button:
needs:
- generate-arm-template
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- name: rebase-before-run
run: |
git config --global user.name 'Gitub Action Bot'
git config --global user.email 'wilfried.woivre@users.noreply.github.com'
git pull --rebase
- name: generate-deploy-button
id: generate-deploy-button
uses: wilfriedwoivre/action-deploy-azure-button@v2.0
env:
templatePath: 'iac/azuredeploy.json'
markdownPath: 'Readme.md'
branchName: 'v3'
targetAzureUrl: 'https://portal.azure.com/#create/Microsoft.Template/uri/'
- name: debug
run: echo ${{ steps.generate-deploy-button.outputs.fileUpdated }}
- name: push-update
if: steps.generate-deploy-button.outputs.fileUpdated == 'True'
run: |
git config --global user.name 'Gitub Action Bot'
git config --global user.email 'wilfried.woivre@users.noreply.github.com'
git add .
git diff --quiet && git diff --staged --quiet || git commit -am "Add Azure deploy button"
git pull --rebase
git push