generated from hanseartic/react_gh_pages
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.32 KB
/
publish_gh_pages.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
name: publish to github-pages
on:
workflow_dispatch:
schedule:
- cron: '3 0 1 * *'
push:
branches:
- main
jobs:
publish:
name: build and deploy to GithubPages
runs-on: ubuntu-latest
environment:
name: github-pages
url: https://thejpegdao.github.io/wallet_check/
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16.x"
- run: npm ci
- name: fetch existing snapshots
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh_pages
- name: place snapshots in public folder
run: |
cp gh_pages/snapshots/*.json public/snapshots
- name: Take member snapshot
run: npm run snapshot
if: ${{ github.event.schedule != '' }}
continue-on-error: true
env:
SNAPSHOT_ASSET: ${{ secrets.SNAPSHOT_ASSET }}
SNAPSHOT_THRESHOLD: ${{ secrets.SNAPSHOT_THRESHOLD }}
- name: Publish new version of github pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git config user.name github-actions-bot
git config user.email support+actions@github.com
npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}