-
Notifications
You must be signed in to change notification settings - Fork 24
56 lines (47 loc) · 1.59 KB
/
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
name: github pages
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/[email protected]
with:
node-version: '16.x'
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn
- name: Build
run: npm run build && cp build/index.html build/404.html
env:
REACT_APP_STARCOIN_API_URL: ${{ secrets.API_URL }}
REACT_APP_STARCOIN_NETWORKS: ${{ secrets.AVAILABLE_NETWORKS }}
- name: Deploy to github pages(https://explorer.starcoin.org)
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: starcoin-explorer/starcoin-explorer.github.io
publish_branch: master
publish_dir: ./build
full_commit_message: ${{ github.event.head_commit.message }}
- run: rm ./build/CNAME
- name: Deploy to aws s3(https://stcscan.io)
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --delete
env:
AWS_S3_BUCKET: 'stcscan.io'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-1'
SOURCE_DIR: 'build'