-
Notifications
You must be signed in to change notification settings - Fork 24
322 lines (319 loc) · 14.9 KB
/
dev_on_push_workflow_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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: '2 [pull/pr] Initiate workflow'
on:
push:
branches:
- master
tags:
- '**'
pull_request:
permissions:
contents: read
id-token: write
jobs:
yarn-install:
uses: ./.github/workflows/dev_on_workflow_install.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
check-proxy-version-staging:
name: Check staging proxy tag
if: startsWith(github.ref, 'refs/tags/hotfix-staging') || startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/dev_on_workflow_check_proxy_version.yml
with:
WEBAPP_URL: https://app.staging.passculture.team
check-proxy-version-production:
name: Check production proxy tag
if: startsWith(github.ref, 'refs/tags/prod-hard-deploy') || startsWith(github.ref, 'refs/tags/hotfix-production')
uses: ./.github/workflows/dev_on_workflow_check_proxy_version.yml
with:
WEBAPP_URL: https://passculture.app
check-server-folder-changes:
name: Check server folder changes
if: ${{ ! (startsWith(github.ref, 'refs/tags/hotfix-staging') || startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/prod-hard-deploy') || startsWith(github.ref, 'refs/tags/hotfix-production')) }}
uses: ./.github/workflows/dev_on_workflow_check_folder_change.yml
with:
folder: server/**
check-server-folder-changes-staging:
name: Check server folder changes staging
needs: check-proxy-version-staging
uses: ./.github/workflows/dev_on_workflow_check_folder_change.yml
with:
base_sha: ${{ needs.check-proxy-version-staging.outputs.proxy_base_tag }}
folder: server/**
fetch-tags: true
check-server-folder-changes-production:
name: Check server folder changes production
needs: check-proxy-version-production
uses: ./.github/workflows/dev_on_workflow_check_folder_change.yml
with:
base_sha: ${{ needs.check-proxy-version-production.outputs.proxy_base_tag }}
folder: server/**
fetch-tags: true
check-storybook-folder-changes:
name: Check storybook folder changes
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
uses: ./.github/workflows/dev_on_workflow_check_folder_change.yml
with:
folder: |
.storybook/**
src/**
yarn-linter:
needs: yarn-install
uses: ./.github/workflows/dev_on_workflow_linter_ts.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
yarn-ts-prune:
needs: yarn-install
uses: ./.github/workflows/dev_on_workflow_ts_prune.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
yarn-ts-noUncheckedIndexedAccess:
needs: yarn-install
uses: ./.github/workflows/dev_on_workflow_ts_noUncheckedIndexedAccess.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
yarn-tester:
needs: yarn-linter
uses: ./.github/workflows/dev_on_workflow_tester.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
yarn-chromatic:
needs: [yarn-linter, check-storybook-folder-changes]
uses: ./.github/workflows/dev_on_workflow_chromatic.yml
if: needs.check-storybook-folder-changes.outputs.folder_changed == 'true'
secrets:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
soft-deploy-testing:
needs: yarn-tester
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/dev_on_workflow_environment_soft_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: testing
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
soft-deploy-staging:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/hotfix-staging')
uses: ./.github/workflows/dev_on_workflow_environment_soft_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: staging
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
soft-deploy-production:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/hotfix-production')
uses: ./.github/workflows/dev_on_workflow_environment_soft_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: production
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-android-testing:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/testing')
uses: ./.github/workflows/dev_on_workflow_environment_android_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: testing
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-ios-testing:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/testing')
uses: ./.github/workflows/dev_on_workflow_environment_ios_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: testing
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-android-staging:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/dev_on_workflow_environment_android_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: staging
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-ios-staging:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/dev_on_workflow_environment_ios_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: staging
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-android-production:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/prod-hard-deploy')
uses: ./.github/workflows/dev_on_workflow_environment_android_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: production
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
hard-deploy-ios-production:
needs: yarn-tester
if: startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/dev_on_workflow_environment_ios_deploy.yml
with:
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
ENV: production
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-testing:
needs: [soft-deploy-testing, hard-deploy-android-testing, hard-deploy-ios-testing]
# see https://stackoverflow.com/a/66358138 for details
if: ${{ always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && github.ref == 'refs/heads/master'}}
uses: ./.github/workflows/dev_on_workflow_web_deploy.yml
with:
ENV: testing
BUCKET_NAME: passculture-metier-ehp-testing-decliweb
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-perf:
needs: [soft-deploy-testing, hard-deploy-android-testing, hard-deploy-ios-testing]
if: ${{ always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && github.ref == 'refs/heads/master'}}
uses: ./.github/workflows/dev_on_workflow_web_deploy.yml
with:
ENV: perf
BUCKET_NAME: passculture-metier-ehp-perf-decliweb
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-staging:
needs: [yarn-tester]
if: startsWith(github.ref, 'refs/tags/hotfix-staging') || startsWith(github.ref, 'refs/tags/patch') || startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/dev_on_workflow_web_deploy.yml
with:
ENV: staging
BUCKET_NAME: passculture-metier-ehp-staging-decliweb
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-testing:
needs: [check-server-folder-changes, yarn-tester]
if: needs.check-server-folder-changes.outputs.folder_changed == 'true' && github.ref == 'refs/heads/master'
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
ENV: testing
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-perf:
needs: [check-server-folder-changes, yarn-tester]
if: needs.check-server-folder-changes.outputs.folder_changed == 'true' && github.ref == 'refs/heads/master'
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
ENV: perf
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-staging:
needs: [check-server-folder-changes-staging, deploy-web-staging, check-proxy-version-staging]
if: needs.check-server-folder-changes-staging.outputs.folder_changed == 'true' && needs.check-proxy-version-staging.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
ENV: staging
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-integration:
needs: [yarn-tester]
if: startsWith(github.ref, 'refs/tags/hotfix-prod') || startsWith(github.ref, 'refs/tags/prod-hard-deploy')
uses: ./.github/workflows/dev_on_workflow_web_deploy.yml
with:
ENV: integration
BUCKET_NAME: passculture-metier-ehp-integration-decliweb
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-integration:
needs:
[
check-server-folder-changes-production,
deploy-web-integration,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
ENV: integration
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-production:
needs: [yarn-tester]
if: startsWith(github.ref, 'refs/tags/hotfix-prod') || startsWith(github.ref, 'refs/tags/prod-hard-deploy')
uses: ./.github/workflows/dev_on_workflow_web_deploy.yml
with:
ENV: production
BUCKET_NAME: passculture-metier-prod-production-decliweb
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-production:
needs:
[
check-server-folder-changes-production,
deploy-web-production,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
ENV: production
CACHE_BUCKET_NAME: passculture-infra-prod-github-runner-cache
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
GCP_PROD_SERVICE_ACCOUNT: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT }}
GCP_PROD_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_PROD_WORKLOAD_IDENTITY_PROVIDER }}
update-jira-issues:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/dev_on_workflow_update_jira_issues.yml
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
run-e2e-tests-android:
needs: hard-deploy-android-staging
uses: ./.github/workflows/dev_on_workflow_run_e2e_android.yml
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}