-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (39 loc) · 1.04 KB
/
build.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
name: build
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14.16.0'
- name: Install dependencies
run: npm install
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.100.2'
extended: true
- name: Build
run: npm run build
- name: Deploy
env:
TZ: Asia/Shanghai
DEPLOY_REPO: guanqr/guanqr.github.io
DEPLOY_BRANCH: master
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: |
cd ./public && git init
git config user.name "guanqr"
git config user.email "guanqirui@zju.edu.cn"
git add .
git commit -m "Automated Deployment @ $(date '+%Y-%m-%d %H:%M:%S') ${TZ}"
git push --force --quiet "https://$PERSONAL_TOKEN@github.com/$DEPLOY_REPO" master:$DEPLOY_BRANCH