-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 930 Bytes
/
deploy.yml
File metadata and controls
36 lines (29 loc) · 930 Bytes
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
name: Hexo Deploy
on:
push:
branches:
- main # 只有推送至 main 分支时才触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true # 如果你的主题是 git submodule 引入的,必须加这行
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20' # 建议使用 LTS 版本
- name: Install Dependencies
run: npm install
- name: Clean
run: npx hexo clean
- name: Generate
run: npm run build # 对应 hexo generate
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # 自动获取,无需配置
publish_dir: ./public # 部署 public 文件夹下的内容
publish_branch: gh-pages # 指定部署到哪个分支