-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (81 loc) · 2.72 KB
/
sub-cd.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
name: ❖ CD
#TODO: If we publish the app then deploy infra, we don't need to run app-deploy
on:
workflow_call:
inputs:
deploy-infra:
description: "Deploy infrastructure"
type: boolean
default: true
deploy-app:
description: "Deploy app"
type: boolean
default: true
deploy-prod:
description: "Deploy to production"
type: boolean
default: false
version:
description: "The release version"
type: string
required: true
concurrency: cd
permissions:
contents: read
id-token: write
jobs:
deploy-infra-staging:
name: Deploy Infra Staging
uses: ./.github/workflows/sub-infra-apply.yml
if: ${{ inputs.deploy-infra }}
secrets: inherit
with:
version: ${{ inputs.version }}
stage: staging
stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health
deploy-app-staging:
name: Deploy App Staging
uses: ./.github/workflows/sub-app-deploy.yml
if: ${{ (always() && !failure() && !cancelled()) && inputs.deploy-app }}
needs: [deploy-infra-staging]
with:
version: ${{ inputs.version }}
stage: staging
stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health
aws-role-arn: ${{ vars.AWS_ROLE_STAGING }}
validate-staging:
name: Validate - Staging
if: ${{ always() && !failure() && !cancelled() }}
needs: [deploy-infra-staging, deploy-app-staging]
uses: ./.github/workflows/sub-validate.yml
with:
stage: staging
stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health
deploy-infra-prod:
name: Deploy Infra Prod
uses: ./.github/workflows/sub-infra-apply.yml
if: ${{ always() && !failure() && !cancelled() && inputs.deploy-infra && inputs.deploy-prod }}
needs: [validate-staging]
secrets: inherit
with:
version: ${{ inputs.version }}
stage: prod
stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health
deploy-app-prod:
name: Deploy App Prod
uses: ./.github/workflows/sub-app-deploy.yml
if: ${{ always() && !failure() && !cancelled() && inputs.deploy-app && inputs.deploy-prod }}
needs: [validate-staging, deploy-infra-prod]
with:
version: ${{ inputs.version }}
stage: prod
stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health
aws-role-arn: ${{ vars.AWS_ROLE_PROD }}
validate-prod:
name: Validate - Prod
if: ${{ always() && !failure() && !cancelled() }}
needs: [deploy-infra-prod, deploy-app-prod]
uses: ./.github/workflows/sub-validate.yml
with:
stage: prod
stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health