-
Notifications
You must be signed in to change notification settings - Fork 18
153 lines (136 loc) · 4.95 KB
/
mpc-recovery-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
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
name: Deploy to Prod environments.
on:
workflow_dispatch:
inputs:
network:
type: choice
options:
- mainnet
- testnet
description: mainnet or testnet network
required: true
version:
description: What mainnet version number is this deployment? (e.g. v0.1.0)
required: true
env:
PROJECT_PROD: "pagoda-discovery-platform-prod"
REGION: "us-east1"
IMAGE: us-east1-docker.pkg.dev/pagoda-discovery-platform-dev/mpc-recovery/mpc-recovery:${{ github.sha }}
jobs:
build-mpc-recovery:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
name: "Checkout mpc-recovery"
- name: Login to Artifact Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGION }}-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_CREDENTIALS_DEV }}
- name: Build Docker image and push to Google Artifact Registry
id: docker-push-tagged
uses: docker/build-push-action@v4
with:
push: true
file: ./Dockerfile
tags: "${{ env.IMAGE }}:${{ github.sha }}"
deploy-mpc-recovery-testnet:
runs-on: ubuntu-latest
if: github.event.inputs.network == 'testnet'
needs: build-mpc-recovery
env:
name: PROD
steps:
- uses: actions/checkout@v3
name: "Checkout mpc-recovery"
- name: "Authenticate to GCloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS_DEV }}"
- name: Deploy leader to Cloud Run Testnet
id: deploy-leader
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-leader-testnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run testnet
id: deploy-signer-0-testnet
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-0-testnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run testnet
id: deploy-signer-1-testnet
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-1-testnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run testnet
id: deploy-signer-2-testnet
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-2-testnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
deploy-mpc-recovery-mainnet:
runs-on: ubuntu-latest
if: github.event.inputs.network == 'mainnet'
needs: build-mpc-recovery
env:
name: PROD
steps:
- uses: actions/checkout@v3
name: "Checkout mpc-recovery"
- name: "Authenticate to GCloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS_DEV }}"
- name: Deploy leader to Cloud Run mainnet
id: deploy-leader
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-leader-mainnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run mainnet
id: deploy-signer-0
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-0-mainnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run mainnet
id: deploy-signer-1
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-1-mainnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"
- name: Deploy signer to Cloud Run mainnet
id: deploy-signer-2
uses: google-github-actions/deploy-cloudrun@v1
with:
image: "${{ env.IMAGE }}:${{ github.sha }}"
service: mpc-recovery-signer-2-mainnet
region: us-east1
project_id: "${{ env.PROJECT_PROD }}"
tag: "${{ github.event.inputs.version }}"