-
Notifications
You must be signed in to change notification settings - Fork 71
119 lines (102 loc) · 3.42 KB
/
deploy-prod.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
name: "Deploy production"
"on":
workflow_dispatch:
inputs:
ref:
type: string
description: "The branch, tag or SHA to checkout"
required: true
default: "main"
preview_env:
type: string
description: "Test on goerli or mainnet"
required: true
default: "goerli"
jobs:
build_and_preview:
if: ${{ github.event.repository.full_name == github.repository }}
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v2
with:
ref: "${{ github.event.inputs.ref }}"
- name: "Enable yarn cache"
uses: c-hive/gha-yarn-cache@v2 # using cache
- name: "Setup node@16"
uses: actions/setup-node@v2
with:
node-version: 16
- name: "Install dependencies"
run: |
yarn set version 3.1.1
yarn install
- name: "Build: env:${{github.event.inputs.preview_env}} for the preview"
run: "yarn run ci:build:${{github.event.inputs.preview_env}}"
- uses: actions/upload-artifact@v2
with:
name: "checkout-dist"
path: "public/"
if-no-files-found: error # "warn" or "ignore" are also available, defaults to `warn`
retention-days: 5
- name: "Setup node@18"
uses: actions/setup-node@v2
with:
node-version: 18
- name: "Deploy: preview prod-${{github.event.inputs.preview_env}}"
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: "${{secrets.GITHUB_TOKEN}}"
firebaseServiceAccount: "${{secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_DEV}}"
target: "staging"
projectId: zsync-dapp-checkout
channelID: "staging_preview"
build_and_deploy:
if: ${{ github.event.repository.full_name == github.repository }}
needs: build_and_preview
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v2
with:
ref: "${{github.event.inputs.ref}}"
- name: "Enable yarn cache"
uses: c-hive/gha-yarn-cache@v2 # using cache
- name: "Setup node@16"
uses: actions/setup-node@v2
with:
node-version: 16
- name: "Install dependencies"
run: |
yarn set version 3.1.1
yarn install
- name: "Deploy target: prod-mainnet"
run: yarn run ci:build:mainnet
- name: "Setup node@18"
uses: actions/setup-node@v2
with:
node-version: 18
- uses: matter-labs/action-hosting-deploy@main
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_PROD }}"
target: "prod-mainnet"
projectId: zsync-dapp-checkout
channelID: live
- name: "Setup node@16"
uses: actions/setup-node@v2
with:
node-version: 16
- name: "Build goerli"
run: yarn run ci:build:goerli
- name: "Setup node@18"
uses: actions/setup-node@v2
with:
node-version: 18
- uses: matter-labs/action-hosting-deploy@main
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_PROD }}"
target: "prod-goerli"
projectId: zsync-dapp-checkout
channelID: live