-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (146 loc) · 7.06 KB
/
copilot_deploy.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Deploy to AWS
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Deploy to {0}', github.event.inputs.environment) || (github.ref == 'refs/heads/main' && 'Deploy to Test-UAT-Prod' || 'Build & Unit Test') }}
on:
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use
type: choice
required: true
options:
- dev
- test
- uat
- prod
run_performance_tests:
required: false
default: false # TODO: Re-enable me when useful
type: boolean
description: Run performance tests
run_e2e_tests_assessment:
required: false
default: false # TODO: Re-enable me when useful
type: boolean
description: Run e2e tests (assessment)
run_e2e_tests_application:
required: false
default: false # TODO: Re-enable me when useful
type: boolean
description: Run e2e tests (application)
push:
jobs:
setup:
uses: communitiesuk/funding-service-design-workflows/.github/workflows/determine-jobs.yml@feature/FSPT-63-skeleton-connexion-app
with:
environment: ${{ inputs.environment }}
pre_deploy_tests:
uses: communitiesuk/funding-service-design-workflows/.github/workflows/pre-deploy.yml@feature/FSPT-63-skeleton-connexion-app
with:
# Note - no db-name, so defaults to postgres_db
postgres_unit_testing: true
# db_name: pre_award_stores
paketo_build:
needs: [ setup ]
concurrency: build-pre-award-stores-pack
permissions:
packages: write
uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@feature/FSPT-63-skeleton-connexion-app
with:
version_to_build: ${{ github.sha }}
owner: ${{ github.repository_owner }}
application: funding-service-pre-award-stores
dev_deploy:
needs: [ pre_deploy_tests, paketo_build, setup ]
if: ${{ contains(fromJSON(needs.setup.outputs.jobs_to_run), 'dev') }}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@feature/FSPT-63-skeleton-connexion-app
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
with:
environment: dev
app_name: pre-award-stores
version: sha-${{ github.sha }}
image_location: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
# db_name: pre_award_stores
post_dev_deploy_tests:
needs: dev_deploy
concurrency:
group: 'fsd-preaward-dev'
cancel-in-progress: false
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@feature/FSPT-63-skeleton-connexion-app
with:
run_performance_tests: ${{ inputs.run_performance_tests || true }}
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || false }}
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || false }}
environment: dev
app_name: pre-award-stores
test_deploy:
needs: [ dev_deploy, post_dev_deploy_tests, paketo_build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'test') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@feature/FSPT-63-skeleton-connexion-app
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
with:
environment: test
app_name: pre-award-stores
version: sha-${{ github.sha }}
image_location: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
# db_name: pre_award_stores
post_test_deploy_tests:
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, paketo_build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'test') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}}
concurrency:
group: 'fsd-preaward-test'
cancel-in-progress: false
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@feature/FSPT-63-skeleton-connexion-app
with:
run_performance_tests: ${{ inputs.run_performance_tests || false }}
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || true }}
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || true }}
environment: test
app_name: pre-award-stores
uat_deploy:
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, paketo_build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'uat') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@feature/FSPT-63-skeleton-connexion-app
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
with:
environment: uat
app_name: pre-award-stores
version: sha-${{ github.sha }}
image_location: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
# db_name: pre_award_stores
post_uat_deploy_tests:
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, uat_deploy, paketo_build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'uat') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}}
concurrency:
group: 'fsd-preaward-uat'
cancel-in-progress: false
secrets:
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }}
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@feature/FSPT-63-skeleton-connexion-app
with:
run_performance_tests: ${{ inputs.run_performance_tests || false }}
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || true }}
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || true }}
environment: uat
app_name: pre-award-stores
prod_deploy:
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, uat_deploy, post_uat_deploy_tests, paketo_build, setup ]
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'prod') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@feature/FSPT-63-skeleton-connexion-app
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
with:
environment: prod
app_name: pre-award-stores
version: sha-${{ github.sha }}
image_location: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
# db_name: pre_award_stores