-
Notifications
You must be signed in to change notification settings - Fork 3
/
dispatch_publish.yml
79 lines (72 loc) · 2.02 KB
/
dispatch_publish.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
name: ⚙️ Publish
run-name: "Publish: ${{ github.sha }}${{ inputs.deploy-to != 'none' && format(' ❱❱ {0}', inputs.deploy-to) || ''}}"
on:
workflow_dispatch:
inputs:
publish-staging:
description: "Publish to Staging"
default: true
required: true
type: boolean
publish-prod:
description: "Publish to Prod"
default: false
required: true
type: boolean
deploy-to:
description: "Deploy published image to"
type: choice
options:
- none
- staging
- prod
default: staging
required: true
concurrency: deploy
permissions:
contents: write
id-token: write
packages: write
jobs:
ci:
name: CI
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@main
secrets: inherit
with:
check-infra: true
check-app: true
select_envs:
name: Select Environments
needs: [ ci ]
runs-on: ubuntu-latest
steps:
- name: Build Envs
id: build_release_envs
uses: WalletConnect/ci_workflows/.github/actions/build-release-envs@main
with:
staging: ${{ inputs.publish-staging }}
prod: ${{ inputs.publish-prod }}
aws-role-staging: ${{ vars.AWS_ROLE_STAGING }}
aws-role-prod: ${{ vars.AWS_ROLE_PROD }}
outputs:
target-envs: ${{ steps.build_release_envs.outputs.target-envs }}
release:
name: Release
needs: [ select_envs ]
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@main
secrets: inherit
with:
infra-changed: false
app-changed: true
publish-envs: ${{ needs.select_envs.outputs.target-envs }}
cd:
name: CD
needs: [ release ]
if : ${{ inputs.deploy-to != 'none' }}
secrets: inherit
uses: .github/workflows/sub-cd.yml
with:
deploy-infra: false
deploy-app: ${{ needs.paths_filter.outputs.app == 'true' }}
deploy-prod: ${{ inputs.deploy-to == 'prod' }}
version: ${{ needs.release.outputs.version }}