-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 2.71 KB
/
main.yml
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
# This is the main workflow which will orchestrate the other workflows:
name: main
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-containers:
name: Build containers
uses: ./.github/workflows/.build.yml
analysis:
name: Analysis
uses: ./.github/workflows/.analysis.yml
secrets: inherit
analysis-results:
name: Analysis Results
needs: [analysis]
if: always()
runs-on: ubuntu-24.04
steps:
- if: contains(needs.*.result, 'failure')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
tests-e2e:
name: Tests
needs: build-containers
uses: ./.github/workflows/.e2e.yml
with:
tag: ${{ github.sha }}
secrets: inherit
deploy-to-aws-dev:
if: github.ref_name == 'main' || github.head_ref == 'main'
name: Deploys Application to AWS dev
needs: tests-e2e
uses: ./.github/workflows/.deploy-app.yml
with:
app_env: dev
command: apply
environment_name: dev
tag: ${{ github.sha }}
secrets: inherit
# Running FTA migration after each dev deployment since we are clearing the database each run
fta-migration:
needs: deploy-to-aws-dev
name: FTA Migration
uses: ./.github/workflows/fta-migration.yml
with:
tag: ${{ github.sha }}
secrets: inherit
# Separate review job since we can't use GitHub environments in reusable workflows
review-test-deployment:
name: Review Test Deployment
needs: [deploy-to-aws-dev]
environment: test
runs-on: ubuntu-24.04
steps:
- name: Review Test Deployment
run: echo "Reviewing Test Deployment"
deploy-to-aws-test:
name: Deploys Application to AWS test
needs: [review-test-deployment]
runs-on: ubuntu-24.04
steps:
- name: Deploy to AWS test
# Placeholder
run: echo "Deploying to AWS test"
release:
name: Release
needs: [deploy-to-aws-test]
uses: ./.github/workflows/.release.yml
promote:
name: Promote
needs: [release]
uses: ./.github/workflows/.promote.yml
# Separate review job since we can't use GitHub environments in reusable workflows
review-prod-deployment:
name: Review Prod Deployment
needs: [promote]
environment: prod
runs-on: ubuntu-24.04
steps:
- name: Review Prod Deployment
run: echo "Reviewing Prod Deployment"
deploy-to-aws-prod:
name: Deploys Application to AWS prod
needs: [deploy-to-aws-test]
environment: prod
runs-on: ubuntu-24.04
steps:
- name: Deploy to AWS prod
# Placeholder
run: echo "Deploying to AWS prod"