-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.09 KB
/
deploy.yml
File metadata and controls
36 lines (30 loc) · 1.09 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
name: Deploy Hexo Site to Pages
on:
push:
branches:
- main # 或者你的主分支名称,比如 master
workflow_dispatch: # 允许手动触发
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3 # 或者最新版
- name: Setup Node.js
uses: actions/setup-node@v3 # 或者最新版
with:
node-version: '18' # 或者你希望使用的 Node.js 版本
cache: 'npm'
- name: Install Dependencies
run: npm install
- name: Build
run: hexo generate
- name: Deploy
uses: peaceiris/actions-gh-pages@v3 # 或者最新版
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# 如果你的 GitHub Pages 是 User/Organization Pages (例如 <username>.github.io)
# 并且你的源码在 main/master 分支,部署到 gh-pages 分支,那么通常不需要 cname
# 如果是 Project Pages,或者自定义域名,可能需要配置 cname
# cname: your-custom-domain.com