-
Notifications
You must be signed in to change notification settings - Fork 9
111 lines (99 loc) · 2.93 KB
/
primary.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Primary Workflow
concurrency:
group: iac
cancel-in-progress: true
on:
push:
permissions:
id-token: write
contents: read
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run-iac: ${{ steps.check.outputs.run-iac }}
run-backend: ${{ steps.check.outputs.run-backend }}
run-frontend: ${{ steps.check.outputs.run-frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: check
with:
filters: |
run-iac:
- 'tofu/**'
- '.github/workflows/**'
run-backend:
- 'backend/**'
- 'tofu/modules/services/backend-service/**'
run-frontend:
- 'frontend/**'
verify-iac:
needs: detect-changes
if: github.ref != 'refs/heads/main' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage, production]
uses: ./.github/workflows/verify-iac.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
apply-iac:
needs: detect-changes
if: github.ref == 'refs/heads/main' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage]
uses: ./.github/workflows/apply-iac.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
ci-tests:
needs: detect-changes
if: github.ref == 'refs/heads/main' && (needs.detect-changes.outputs.run-backend == 'true' || needs.detect-changes.outputs.run-frontend == 'true')
uses: ./.github/workflows/ci-tests.yaml
verify-backend:
needs: detect-changes
if: github.ref != 'refs/heads/main' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage, production]
uses: ./.github/workflows/verify-backend.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
deploy-backend:
needs: detect-changes
if: github.ref == 'refs/heads/main' && needs.detect-changes.outputs.run-backend == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage]
uses: ./.github/workflows/deploy-backend.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
deploy-frontend:
needs: detect-changes
if: github.ref == 'refs/heads/main' && needs.detect-changes.outputs.run-frontend == 'true'
uses: ./.github/workflows/deploy-frontend.yaml
with:
aws_region: us-east-1
bucket: tb-apmt-stage-frontend
build_environment: staging
secrets: inherit