-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.33 KB
/
workflow.yml
File metadata and controls
44 lines (37 loc) · 1.33 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
name: Deploy DataMate Website to GitHub Pages
on:
push:
branches: [ main ] # 监听 main 分支的推送
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true # 拉取主题子模块
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest' # 使用最新版 Hugo
extended: true # 启用 extended 版本
# 新增步骤:安装 Node.js(PostCSS 依赖 Node 环境)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20 # 使用稳定版本的 Node.js
# 新增步骤:安装 PostCSS 及相关依赖
- name: Install PostCSS
run: |
npm install
- name: Build site
run: hugo --minify # 构建并压缩静态文件
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # 自动生成的 Token
publish_dir: ./public # 部署 public 目录
# 若部署到个人主页(yourname.github.io),需设置为 main 分支:
publish_branch: gh-pages
# 若部署到项目站点,默认部署到 gh-pages 分支,无需修改