-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (49 loc) · 1.77 KB
/
deploy.yaml
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
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v2
- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
id: 'auth'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WIP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
token_format: access_token
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: "469.0.0"
- name: Build to Mainnet Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks.json
REACT_APP_LABELS_PER_UNIT: 4294967296
run: |
yarn
yarn build
- name: Upload to Mainnet Explorer
run: gsutil -m rsync -r -d ./build gs://spacemesh-explorer
- name: Set cache-control headers for Mainnet Explorer
run: gsutil -m setmeta -h "Cache-Control:public, max-age=0, no-transform" -r gs://spacemesh-explorer/index.html
- name: Remove build dir
run: rm -rf ./build
- name: Build to Dev Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks-dev.json
REACT_APP_LABELS_PER_UNIT: 1024
run: |
yarn
yarn build
- name: Upload to Dev Explorer
run: gsutil -m rsync -r -d ./build gs://explorer-dev.spacemesh.network
- name: Set cache-control headers for Dev Explorer
run: gsutil -m setmeta -h "Cache-Control:public, max-age=0, no-transform" -r gs://explorer-dev.spacemesh.network/index.html