forked from ziqin/ccse-mirrors-web
-
Notifications
You must be signed in to change notification settings - Fork 30
71 lines (60 loc) · 1.62 KB
/
static-site.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
name: Build static site
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
name: Build site
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Shanghai"
- name: Check Time
run: date
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check yarn / node version
run: |
echo "yarn version `yarn --version`"
echo "node version `node -v`"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install Dependencies
run: yarn install
- name: Build Site
run: yarn build
- name: Deploy to GitHub page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: ./site/.vuepress/dist/
publish_branch: static-site
force_orphan: true
# build-and-deploy:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# with:
# fetch-depth: 0
# - name: vuepress-deploy
# uses: jenkey2011/[email protected]
# env:
# ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# TARGET_REPO: SUSTech-CRA/ccse-mirrors-web
# TARGET_BRANCH: static-site
# BUILD_SCRIPT: yarn && yarn build
# BUILD_DIR: site/.vuepress/dist/
# TZ: Asia/Shanghai