语雀自动发布hexo

语语雀自动发布 hexo

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
name: Blog CI/CD

on: [push, repository_dispatch]

jobs:
blog-cicd:
name: Hexo blog build & deploy
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
- name: Checkout codes
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: |
npm install hexo-cli -g
npm install yuque-hexo -g
npm install
yuque-hexo sync
- name: Generate files
run: hexo generate

- name: Deploy blog
run: |
git clone "https://${{ secrets.GH_REF }}" deploy_git
mv ./deploy_git/.git ./public/
cd ./public
git config user.name "linuxxx"
git config user.email "[email protected]"
git add .
git commit -m "GitHub Actions Auto Builder at $(date +'%Y-%m-%d %H:%M:%S')"
git push --force --quiet "https://${{ secrets.GH_TOKEN }}@${{ secrets.GH_REF }}" master:master

测试正文!
参考文章:https://yichen115.github.io/2020/07/16/gtb5ck/ 感谢!


语雀自动发布hexo
http://blog.uzilol.cn/2022/02/10/yuque/%E8%AF%AD%E9%9B%80%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83hexo/
作者
ive_e (leoli)
发布于
2022年2月10日
许可协议