Skip to content

Commit a64b475

Browse files
commit
0 parents  commit a64b475

File tree

65 files changed

+4591
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4591
-0
lines changed

.github/workflows/dev.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: dev
2+
3+
4+
# on:
5+
# push:
6+
# paths:
7+
# - 'environments/dev.tfvars'
8+
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
paths:
15+
- 'environments/dev.tfvars'
16+
pull_request:
17+
branches:
18+
- main
19+
paths:
20+
- 'environments/dev.tfvars'
21+
22+
23+
workflow_dispatch:
24+
inputs:
25+
do_init: { type: boolean, default: true, description: "Run terraform init?" }
26+
do_fmt: { type: boolean, default: true, description: "Run terraform fmt?" }
27+
do_validate: { type: boolean, default: true, description: "Run terraform validate?" }
28+
do_plan: { type: boolean, default: true, description: "Run terraform plan?" }
29+
do_apply: { type: boolean, default: false, description: "Run terraform apply?" }
30+
do_destroy: { type: boolean, default: false, description: "Run terraform destroy?" }
31+
32+
33+
permissions:
34+
contents: read
35+
id-token: write
36+
37+
38+
jobs:
39+
call:
40+
uses: ./.github/workflows/terraform-multi(runsOnSelfHosted).yaml
41+
with:
42+
environment: dev
43+
tfvars_file: environments/dev.tfvars
44+
rgname: ritkargs
45+
saname: ritkasas
46+
scname: ritkascs
47+
key: dev.tfstate
48+
49+
# runInit: true
50+
# runFmt: true
51+
# runValidate: true
52+
# runPlan: true
53+
# runApply: true
54+
# runDestroy: false
55+
56+
# 👇 Simple clear logic
57+
# If push → only init/fmt/validate/plan true
58+
# If manual → follow checkbox inputs
59+
# runInit: ${{ github.event_name == 'push' || inputs.do_init }}
60+
# runFmt: ${{ github.event_name == 'push' || inputs.do_fmt }}
61+
# runValidate: ${{ github.event_name == 'push' || inputs.do_validate }}
62+
# runPlan: ${{ github.event_name == 'push' || inputs.do_plan }}
63+
# runApply: ${{ github.event_name != 'push' && inputs.do_apply }}
64+
# runDestroy: ${{ github.event_name != 'push' && inputs.do_destroy }}
65+
66+
67+
runInit: ${{ github.event_name != 'workflow_dispatch' || inputs.do_init }}
68+
runFmt: ${{ github.event_name != 'workflow_dispatch' || inputs.do_fmt }}
69+
runValidate: ${{ github.event_name != 'workflow_dispatch' || inputs.do_validate }}
70+
runPlan: ${{ github.event_name != 'workflow_dispatch' || inputs.do_plan }}
71+
runApply: ${{ github.event_name == 'workflow_dispatch' && inputs.do_apply }}
72+
runDestroy: ${{ github.event_name == 'workflow_dispatch' && inputs.do_destroy }}
73+
74+
75+
secrets:
76+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
77+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
78+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

.github/workflows/prod.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: prod
2+
3+
# on:
4+
# push:
5+
# paths:
6+
# - 'environments/prod.tfvars'
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'environments/prod.tfvars'
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- 'environments/prod.tfvars'
19+
20+
21+
workflow_dispatch:
22+
inputs:
23+
do_init: { type: boolean, default: true, description: "Run terraform init?" }
24+
do_fmt: { type: boolean, default: true, description: "Run terraform fmt?" }
25+
do_validate: { type: boolean, default: true, description: "Run terraform validate?" }
26+
do_plan: { type: boolean, default: true, description: "Run terraform plan?" }
27+
do_apply: { type: boolean, default: false, description: "Run terraform apply?" }
28+
do_destroy: { type: boolean, default: false, description: "Run terraform destroy?" }
29+
30+
permissions:
31+
contents: read
32+
id-token: write
33+
34+
jobs:
35+
call:
36+
uses: ./.github/workflows/terraform-multi(runsOnSelfHosted).yaml
37+
with:
38+
environment: prod
39+
tfvars_file: environments/prod.tfvars
40+
rgname: ritkargs
41+
saname: ritkasas
42+
scname: ritkascs
43+
key: prod.tfstate
44+
45+
# runInit: true
46+
# runFmt: true
47+
# runValidate: true
48+
# runPlan: true
49+
# runApply: true
50+
# runDestroy: false
51+
52+
# 👇 Simple clear logic
53+
# If push → only init/fmt/validate/plan true
54+
# If manual → follow checkbox inputs
55+
# runInit: ${{ github.event_name == 'push' || inputs.do_init }}
56+
# runFmt: ${{ github.event_name == 'push' || inputs.do_fmt }}
57+
# runValidate: ${{ github.event_name == 'push' || inputs.do_validate }}
58+
# runPlan: ${{ github.event_name == 'push' || inputs.do_plan }}
59+
# runApply: ${{ github.event_name == 'push' || inputs.do_apply }}
60+
# runDestroy: ${{ github.event_name != 'push' && inputs.do_destroy }}
61+
62+
63+
runInit: ${{ github.event_name != 'workflow_dispatch' || inputs.do_init }}
64+
runFmt: ${{ github.event_name != 'workflow_dispatch' || inputs.do_fmt }}
65+
runValidate: ${{ github.event_name != 'workflow_dispatch' || inputs.do_validate }}
66+
runPlan: ${{ github.event_name != 'workflow_dispatch' || inputs.do_plan }}
67+
# runApply: ${{ github.event_name == 'workflow_dispatch' && inputs.do_apply }}
68+
runApply: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.do_apply) }}
69+
70+
runDestroy: ${{ github.event_name == 'workflow_dispatch' && inputs.do_destroy }}
71+
72+
73+
secrets:
74+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
75+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
76+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

.github/workflows/qa.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: qa
2+
on:
3+
push:
4+
paths:
5+
- 'environments/qa.tfvars'
6+
7+
workflow_dispatch:
8+
inputs:
9+
do_init: { type: boolean, default: true, description: "Run terraform init?" }
10+
do_fmt: { type: boolean, default: true, description: "Run terraform fmt?" }
11+
do_validate: { type: boolean, default: true, description: "Run terraform validate?" }
12+
do_plan: { type: boolean, default: true, description: "Run terraform plan?" }
13+
do_apply: { type: boolean, default: false, description: "Run terraform apply?" }
14+
do_destroy: { type: boolean, default: false, description: "Run terraform destroy?" }
15+
16+
permissions:
17+
contents: read
18+
id-token: write
19+
20+
jobs:
21+
call:
22+
uses: ./.github/workflows/terraform-multi(runsOnSelfHosted).yaml
23+
with:
24+
environment: qa
25+
tfvars_file: environments/qa.tfvars
26+
rgname: ritkargs
27+
saname: ritkasas
28+
scname: ritkascs
29+
key: qa.tfstate
30+
31+
# runInit: true
32+
# runFmt: true
33+
# runValidate: true
34+
# runPlan: true
35+
# runApply: true
36+
# runDestroy: false
37+
38+
# 👇 Simple clear logic
39+
# If push → only init/fmt/validate/plan true
40+
# If manual → follow checkbox inputs
41+
runInit: ${{ github.event_name == 'push' || inputs.do_init }}
42+
runFmt: ${{ github.event_name == 'push' || inputs.do_fmt }}
43+
runValidate: ${{ github.event_name == 'push' || inputs.do_validate }}
44+
runPlan: ${{ github.event_name == 'push' || inputs.do_plan }}
45+
runApply: ${{ github.event_name != 'push' && inputs.do_apply }}
46+
runDestroy: ${{ github.event_name != 'push' && inputs.do_destroy }}
47+
48+
secrets:
49+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
50+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
51+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

0 commit comments

Comments
 (0)