-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (62 loc) · 2.52 KB
/
dev.yaml
File metadata and controls
78 lines (62 loc) · 2.52 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
70
71
72
73
74
75
76
77
78
name: dev
# on:
# push:
# paths:
# - 'environments/dev.tfvars'
on:
push:
branches:
- main
paths:
- 'environments/dev.tfvars'
pull_request:
branches:
- main
paths:
- 'environments/dev.tfvars'
workflow_dispatch:
inputs:
do_init: { type: boolean, default: true, description: "Run terraform init?" }
do_fmt: { type: boolean, default: true, description: "Run terraform fmt?" }
do_validate: { type: boolean, default: true, description: "Run terraform validate?" }
do_plan: { type: boolean, default: true, description: "Run terraform plan?" }
do_apply: { type: boolean, default: false, description: "Run terraform apply?" }
do_destroy: { type: boolean, default: false, description: "Run terraform destroy?" }
permissions:
contents: read
id-token: write
jobs:
call:
uses: ./.github/workflows/terraform-multi(runsOnSelfHosted).yaml
with:
environment: dev
tfvars_file: environments/dev.tfvars
rgname: ritkargs
saname: ritkasas
scname: ritkascs
key: dev.tfstate
# runInit: true
# runFmt: true
# runValidate: true
# runPlan: true
# runApply: true
# runDestroy: false
# 👇 Simple clear logic
# If push → only init/fmt/validate/plan true
# If manual → follow checkbox inputs
# runInit: ${{ github.event_name == 'push' || inputs.do_init }}
# runFmt: ${{ github.event_name == 'push' || inputs.do_fmt }}
# runValidate: ${{ github.event_name == 'push' || inputs.do_validate }}
# runPlan: ${{ github.event_name == 'push' || inputs.do_plan }}
# runApply: ${{ github.event_name != 'push' && inputs.do_apply }}
# runDestroy: ${{ github.event_name != 'push' && inputs.do_destroy }}
runInit: ${{ github.event_name != 'workflow_dispatch' || inputs.do_init }}
runFmt: ${{ github.event_name != 'workflow_dispatch' || inputs.do_fmt }}
runValidate: ${{ github.event_name != 'workflow_dispatch' || inputs.do_validate }}
runPlan: ${{ github.event_name != 'workflow_dispatch' || inputs.do_plan }}
runApply: ${{ github.event_name == 'workflow_dispatch' && inputs.do_apply }}
runDestroy: ${{ github.event_name == 'workflow_dispatch' && inputs.do_destroy }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}