-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (55 loc) · 2.86 KB
/
Copy pathdev.yaml
File metadata and controls
71 lines (55 loc) · 2.86 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
name: dev
on:
push:
branches:
- main
paths:
- 'environments/dev.tfvars'
workflow_dispatch:
inputs:
use_environment_init: { type: boolean, default: false, description: "Require approval before Init?" }
do_init: { type: boolean, default: false, description: "Run terraform init + fmt + validate?" }
use_environment_plan: { type: boolean, default: false, description: "Require approval before Plan?" }
do_plan: { type: boolean, default: false, description: "Run terraform plan?" }
use_environment_apply: { type: boolean, default: false, description: "Require approval before Apply?" }
do_apply: { type: boolean, default: false, description: "Run terraform apply?" }
use_environment_destroy: { type: boolean, default: false, description: "Require approval before Destroy?" }
do_destroy: { type: boolean, default: false, description: "Run terraform destroy?" }
permissions:
contents: read
id-token: write
concurrency:
group: dev-tf
cancel-in-progress: false
jobs:
call:
uses: ./.github/workflows/terraform-multi.yml
with:
environment: dev
tfvars_file: environments/dev.tfvars
rgname: ritkargr
saname: ritkasar
scname: ritkascr
key: dev.tfstate
# Run toggles
runInit: ${{ github.event_name == 'push' || inputs.do_init == true }}
runPlan: ${{ github.event_name == 'push' || inputs.do_plan == true }}
# ❌ Push par apply nahi chalega
# ✔ Apply sirf manual dispatch ke through chalega
runApply: ${{ github.event_name == 'workflow_dispatch' && inputs.do_apply == true }}
# Destroy only manual
runDestroy: ${{ github.event_name == 'workflow_dispatch' && inputs.do_destroy == true }}
# Approval toggles
useEnvironmentInit: ${{ github.event_name == 'workflow_dispatch' && inputs.use_environment_init == true }}
useEnvironmentPlan: ${{ github.event_name == 'workflow_dispatch' && inputs.use_environment_plan == true }}
# ✔ Apply approval only during manual trigger
useEnvironmentApply: ${{ github.event_name == 'workflow_dispatch' && inputs.use_environment_apply == true }}
useEnvironmentDestroy: ${{ github.event_name == 'workflow_dispatch' && inputs.use_environment_destroy == true }}
secrets:
AZURE_CLIENT_ID_R: ${{ secrets.CLIENT_ID_SUBSCRIPTION_RESOURCES }}
AZURE_TENANT_ID_R: ${{ secrets.TENANT_ID_SUBSCRIPTION_RESOURCES }}
AZURE_SUBSCRIPTION_ID_R: ${{ secrets.SUBSCRIPTION_ID_RESOURCES }}
AZURE_CLIENT_ID_B: ${{ secrets.CLIENT_ID_SUBSCRIPTION_BACKEND }}
AZURE_TENANT_ID_B: ${{ secrets.TENANT_ID_SUBSCRIPTION_BACKEND }}
AZURE_SUBSCRIPTION_ID_B: ${{ secrets.SUBSCRIPTION_ID_BACKEND }}
ARM_ACCESS_KEY: ${{ secrets.ARM_ACCESS_KEY }}