This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (106 loc) · 3.73 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
name: Deploy to AWS
on:
workflow_dispatch:
inputs:
environment:
description: Which AWS Account to use
type: choice
required: true
options:
- dev
- test
- uat
- production
run_performance_tests:
required: false
default: false
type: boolean
description: Run performance tests
run_e2e_tests:
required: false
default: true
type: boolean
description: Run e2e tests
push:
# Ignore README markdown
# Only automatically deploy when something in the app or tests folder has changed
paths:
- '!**/README.md'
- 'app/**'
- 'tests/**'
jobs:
paketo_build:
permissions:
packages: write
uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@main
with:
version_to_build: $(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
owner: ${{ github.repository_owner }}
application: funding-service-design-fund-store
pre_deploy_tests:
secrets:
E2E_PAT: ${{secrets.E2E_PAT}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/pre-deploy.yml@main
with:
# Note - no db-name, so defaults to postgres_db
postgres_unit_testing: true
dev_copilot_deploy:
if: inputs.environment == 'dev' || inputs.environment == ''
needs: [pre_deploy_tests, paketo_build]
concurrency: deploy-dev
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
uses: ./.github/workflows/environment.yml
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
with:
workspace: 'dev'
test_copilot_deploy:
if: inputs.environment == 'test' || inputs.environment == ''
needs: [pre_deploy_tests, paketo_build]
concurrency: deploy-test
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
uses: ./.github/workflows/environment.yml
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
with:
workspace: 'test'
# Allow the capability to override UAT with another branch, but ideally uat and production should be in sync as much as possible
uat_copilot_deploy:
if: inputs.environment == 'uat' || inputs.environment == ''
needs: [pre_deploy_tests, paketo_build]
concurrency: deploy-uat
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
uses: ./.github/workflows/environment.yml
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
with:
workspace: 'uat'
# Only run this if the branch being deployed is main
production_copilot_deploy:
if: (inputs.environment == 'production' || inputs.environment == '') && github.ref == 'refs/heads/main'
needs: [pre_deploy_tests, paketo_build]
concurrency: deploy-production
secrets:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
uses: ./.github/workflows/environment.yml
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
with:
workspace: 'production'
# Can we realistically run E2E at this stage, or just plump for application on the grounds it checks fund-store is operational?
post_deploy_tests:
needs: test_copilot_deploy
secrets:
E2E_PAT: ${{secrets.E2E_PAT}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main
with:
run_performance_tests: ${{ inputs.run_performance_tests }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
app_name: application