-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (151 loc) · 4.52 KB
/
workflow-live-path.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
158
159
160
161
162
163
164
165
name: "[Workflow] Path to Live"
on:
push:
branches:
- main
permissions:
id-token: write
contents: write
security-events: write
pull-requests: read
actions: none
checks: none
deployments: none
issues: none
packages: none
repository-projects: none
statuses: none
defaults:
run:
shell: bash
jobs:
workflow_variables:
runs-on: ubuntu-latest
name: output workflow variables
outputs:
build_identifier: "main"
version_tag: ${{ steps.semver_tag.outputs.created_tag }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v3
- name: generate semver tag and release
id: semver_tag
uses: ministryofjustice/opg-github-actions/.github/actions/[email protected]
with:
prerelease: false
default_bump: "minor"
unit_test_frontend:
name: Unit tests on Frontend app
uses: ./.github/workflows/_tests-frontend.yml
build_scan_push_containers:
name: Docker Build, Scan and Push
uses: ./.github/workflows/_build-push.yml
needs: [workflow_variables]
with:
tag: ${{ needs.workflow_variables.outputs.version_tag }}
branch_name: ${{ needs.workflow_variables.outputs.build_identifier }}
secrets: inherit
deploy_to_development_account:
name: Deploy to Development
needs: [
workflow_variables,
build_scan_push_containers,
unit_test_frontend
]
uses: ./.github/workflows/_deploy-infrastructure.yml
with:
workspace: development
account_name: development
container_version: ${{ needs.workflow_variables.outputs.version_tag }}
terraform_path: account
apply: true
path_to_live: true
secrets: inherit
deploy_to_preproduction_account:
name: Deploy to Preproduction Account
needs: [
workflow_variables,
deploy_to_development_account
]
uses: ./.github/workflows/_deploy-infrastructure.yml
with:
workspace: preproduction
account_name: preproduction
container_version: ${{ needs.workflow_variables.outputs.version_tag }}
terraform_path: account
apply: true
path_to_live: true
secrets: inherit
deploy_to_preproduction_environment:
name: Deploy to Preproduction Environment
needs: [
workflow_variables,
deploy_to_preproduction_account
]
uses: ./.github/workflows/_deploy-infrastructure.yml
with:
workspace: preproduction
account_name: preproduction
container_version: ${{ needs.workflow_variables.outputs.version_tag }}
terraform_path: environment
apply: true
path_to_live: true
secrets: inherit
behat_preproduction:
name: Preproduction Behat Tests
uses: ./.github/workflows/_tests-behat.yml
needs: [
workflow_variables,
deploy_to_preproduction_environment,
]
with:
workspace_name: preproduction
version_tag: ${{ needs.workflow_variables.outputs.version_tag }}
base_url: preproduction.serve.opg.service.justice.gov.uk
sirius_api_bucket: opg-backoffice-public-api-preprod
suite: --suite=main
account_name: preproduction
account_id: 540070264006
secrets: inherit
deploy_to_production_account:
name: Deploy to Production Account
needs: [
workflow_variables,
behat_preproduction
]
uses: ./.github/workflows/_deploy-infrastructure.yml
with:
workspace: production
account_name: production
container_version: ${{ needs.workflow_variables.outputs.version_tag }}
terraform_path: account
apply: true
path_to_live: true
secrets: inherit
deploy_to_production_environment:
name: Deploy to Production Environment
needs: [
workflow_variables,
deploy_to_production_account
]
uses: ./.github/workflows/_deploy-infrastructure.yml
with:
workspace: production
account_name: production
container_version: ${{ needs.workflow_variables.outputs.version_tag }}
terraform_path: environment
apply: true
path_to_live: true
secrets: inherit
behat_prod:
name: Production Smoke Tests
uses: ./.github/workflows/_tests-behat.yml
needs: [workflow_variables,deploy_to_production_environment]
with:
workspace_name: production
version_tag: ${{ needs.workflow_variables.outputs.version_tag }}
base_url: serve.opg.service.justice.gov.uk
sirius_api_bucket: opg-backoffice-public-api-production
suite: --tags @smoke
account_name: production
account_id: 933639921819
secrets: inherit