-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.25 KB
/
hexo.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
name: Hexo pages
on:
push:
branches:
- main # 当推送到 main 分支时触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: false # 禁用子模块检查
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: 安装依赖
run: npm install
- name: 安装hexo
run: |
npm install hexo-deployer-git --save
npm install hexo-cli -g
- name: 创建blog页面
run: |
git clone https://github.com/wyxdlz54188/butterfly.git themes/butterfly
hexo clean
hexo generate
- name: 设置Git配置
run: |
git config --global user.name 'wyxdlz54188'
git config --global user.email '[email protected]'
- name: 上传GitHub pages
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd public/
git init
git add -A
git commit -m "Create by workflows"
git remote add origin https://${{ secrets.GH_TOKEN }}@github.com/wyxdlz54188/wyxdlz54188.github.io.git
git push origin HEAD:gh-pages -f