-
Notifications
You must be signed in to change notification settings - Fork 26
135 lines (119 loc) · 5 KB
/
dashboard-mainnet.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
name: Token Dashboard / Mainnet
on:
push:
branches:
- releases/mainnet/**
release:
types:
- "published"
jobs:
build:
name: Build for mainnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14"
cache: "yarn"
# This step forces Git to download dependencies using `https://` protocol,
# even if `yarn.json` refers to some package via `git://`. Using `git://`
# is no longer supported by GH. One of the dashboard dependencies by
# default uses `git://` and we needed to manually remove it every time
# it re-appeared in the lock file. Now even if it does re-appear, the
# `yarn install --frozen-lockfile` will not fail.
- name: Configure git to don't use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile
- name: Run token-dashboard post-install script
run: yarn run postinstall
# FIXME: It's work in progress, the contracts are not yet published.
# - name: Resolve latest mainnet contracts
# # For PR we expect the dependencies are already set to correct versions.
# if: github.event_name != 'pull_request'
# run: |
# yarn upgrade \
# @threshold-network/contracts@mainnet
- name: Build
if: github.event_name == 'push'
run: yarn build
env:
PUBLIC_URL: /${{ github.ref_name }}
CHAIN_ID: 1
ETH_HOSTNAME_HTTP: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.MAINNET_ETH_HOSTNAME_WS }}
NODE_OPTIONS: --max_old_space_size=4096
ELECTRUM_PROTOCOL: ${{ secrets.MAINNET_ELECTRUMX_PROTOCOL }}
ELECTRUM_HOST: ${{ secrets.MAINNET_ELECTRUMX_HOST }}
ELECTRUM_PORT: ${{ secrets.MAINNET_ELECTRUMX_PORT }}
SENTRY_SUPPORT: true
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
- name: Build
if: github.event_name == 'release'
run: yarn build
env:
PUBLIC_URL: /
CHAIN_ID: 1
ETH_HOSTNAME_HTTP: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.MAINNET_ETH_HOSTNAME_WS }}
NODE_OPTIONS: --max_old_space_size=4096
POSTHOG_SUPPORT: true
POSTHOG_API_KEY: ${{ secrets.MAINNET_POSTHOG_API_KEY }}
POSTHOG_HOSTNAME_HTTP: ${{ secrets.MAINNET_POSTHOG_HOSTNAME_HTTP }}
ELECTRUM_PROTOCOL: ${{ secrets.MAINNET_ELECTRUMX_PROTOCOL }}
ELECTRUM_HOST: ${{ secrets.MAINNET_ELECTRUMX_HOST }}
ELECTRUM_PORT: ${{ secrets.MAINNET_ELECTRUMX_PORT }}
SENTRY_SUPPORT: true
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
- uses: actions/upload-artifact@v3
with:
name: build
path: build
deploy-preview:
name: Deploy mainnet preview
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Deploy PR mainnet preview to GCP
# Temporarily we run the action in version from `alpine-version-413.0.0`
# branch, which contains a fix for the issue introduced in the `414.0.0`
# version of the `cloud-sdk` (`rsync` fails for users with no
# `storage.buckets.get` permission).
uses: thesis/gcp-storage-bucket-action@alpine-version-413.0.0
with:
service-key: ${{ secrets.MAINNET_PREVIEW_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: ${{ secrets.MAINNET_PREVIEW_GOOGLE_PROJECT_ID }}
bucket-name: preview.dashboard.threshold.network
bucket-path: ${{ github.ref_name }}
build-folder: build
deploy:
name: Deploy mainnet
needs: build
if: github.event_name == 'release'
# mainnet environment is protected, it requires an approval before execution.
environment:
name: mainnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Deploy mainnet build to GCP
# Temporarily we run the action in version from `alpine-version-413.0.0`
# branch, which contains a fix for the issue introduced in the `414.0.0`
# version of the `cloud-sdk` (`rsync` fails for users with no
# `storage.buckets.get` permission).
uses: thesis/gcp-storage-bucket-action@alpine-version-413.0.0
with:
service-key: ${{ secrets.MAINNET_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: ${{ secrets.MAINNET_GOOGLE_PROJECT_ID }}
bucket-name: dashboard.threshold.network
build-folder: build
set-website: true
home-page-path: index.html
error-page-path: index.html