-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (87 loc) · 2.32 KB
/
frontdoor-app-service.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
96
97
98
99
100
101
name: frontdoor-app-service
on:
workflow_dispatch:
pull_request:
paths:
- frontdoor-app-service/**
branches:
- main
push:
paths:
- frontdoor-app-service/**
branches:
- main
jobs:
security:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: tfsec
uses: aquasecurity/[email protected]
with:
github_token: ${{ github.token }}
lint:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: cache plugin
with:
path: ~/.tflint.d/plugins
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- uses: terraform-linters/setup-tflint@v3
with:
tflint_version: latest
- name: show version
run: tflint --version
- name: init
run: tflint --init
- name: lint
run: tflint -f compact
plan:
if: github.event_name != 'push'
defaults:
run:
working-directory: frontdoor-app-service
runs-on: ubuntu-latest
env:
ARM_CLIENT_ID: ${{ secrets.AZ_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZ_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
- name: format
run: terraform fmt -recursive
- name: init
run: terraform init
- name: validate
run: terraform validate
- name: plan
run: terraform plan -refresh=false
# apply:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# env:
# ARM_CLIENT_ID: ${{ secrets.AZ_CLIENT_ID }}
# ARM_CLIENT_SECRET: ${{ secrets.AZ_CLIENT_SECRET }}
# ARM_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
# ARM_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
# steps:
# - uses: actions/checkout@v3
# - uses: hashicorp/setup-terraform@v2
#
# - name: format
# run: terraform fmt -recursive
#
# - name: init
# run: terraform init
#
# - name: validate
# run: terraform validate
#
# - name: apply
# run: terraform apply -auto-approve -refresh=false