-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.25 KB
/
deploy-to-github-pages.yml
File metadata and controls
45 lines (39 loc) · 1.25 KB
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
# workflow name
name: Deploy To Github Pages
# 当有 push到仓库和外部触发的时候就运行
on: [push, repository_dispatch]
# YUQUE_TOKEN
# Github_SSH_PRIVATE_KEY
jobs:
deploy:
name: Deploy Hexo Public To Pages
runs-on: ubuntu-latest
steps:
# check it to your workflow can access it
# from: https://github.com/actions/checkout
- name: Checkout Repository gh-pages branch
uses: actions/checkout@v3
with:
ref: main
# from: https://github.com/actions/setup-node
- name: Setup Node.js 16.x
uses: actions/setup-node@master
with:
node-version: "16.x"
# from https://github.com/x-cold/yuque-hexo
- name: Setup Hexo Dependencies and Generate Public Files
env:
YUQUE_TOKEN: ${{ secrets.YUQUE_TOKEN }}
run: |
npm install hexo-cli -g
npm install yuque-hexo -g
npm install
npm run start
# from https://github.com/peaceiris/actions-gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./public
commit_message: ${{ github.event.head_commit.message }}