-
Notifications
You must be signed in to change notification settings - Fork 115
41 lines (36 loc) · 956 Bytes
/
main.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
name: docs
on:
push:
branches:
- master
env:
TZ: Asia/Shanghai
# 任务
jobs:
build-and-deploy:
# 服务器环境:最新版 Ubuntu
runs-on: ubuntu-latest
steps:
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
# 拉取代码
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
# 生成静态文件
- name: Generate pages
run: |
npm i hexo-cli -g
npm i
hexo g
# 部署到 GitHub Pages
- name: Deploy site
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
token: ${{ secrets.GH_TOKEN }}
repository-name: ${{ secrets.GH_REPO}}
branch: gh-pages
folder: public
commit-message: GitHub Actions Auto Builder Docs at ${{ env.NOW }}