-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (81 loc) · 2.29 KB
/
tf-plan.yaml
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
name: Terraform Plan
on:
pull_request:
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
filter:
runs-on: ubuntu-latest
outputs:
gcp: ${{ steps.path-filter.outputs.gcp }}
aws: ${{ steps.path-filter.outputs.aws }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: path-filter
with:
filters: |
gcp:
- "gcp/**"
- ".github/workflows/ci.yaml"
aws:
- "aws/**"
- ".github/workflows/ci.yaml"
gcp-plan-prd:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.gcp == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Plan
uses: ./.github/actions/gcp-plan
with:
env: "production"
gcp-project: ${{ vars.PRD_GCP_PROJECT }}
gcp-project-number: ${{ vars.PRD_GCP_PROJECT_NUMBER }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
gcp-plan-stg:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.gcp == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Plan
uses: ./.github/actions/gcp-plan
with:
env: "staging"
gcp-project: ${{ vars.STG_GCP_PROJECT }}
gcp-project-number: ${{ vars.STG_GCP_PROJECT_NUMBER }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
aws-plan-prd:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.aws == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Plan
uses: ./.github/actions/aws-plan
with:
env: "production"
aws-region: ${{ vars.AWS_REGION }}
aws-role-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
aws-plan-stg:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.aws == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Plan
uses: ./.github/actions/aws-plan
with:
env: "staging"
aws-region: ${{ vars.AWS_REGION }}
aws-role-arn: ${{ vars.AWS_GITHUB_ACTIONS_ROLE_ARN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}