优化 GitHub Pages 部署配置,支持 master 分支,更新 Node.js 版本,调整构建命令,添加详细部署说明

This commit is contained in:
2025-06-27 16:46:13 +08:00
parent 5064d43bdb
commit b6accfc111
7 changed files with 259 additions and 22 deletions

View File

@@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
on:
# 当推送到main分支时触发
push:
branches: [ main ]
branches: [ main, master ]
# 允许手动触发工作流
workflow_dispatch:
@@ -30,14 +30,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Build for GitHub Pages
run: npm run build:github
- name: Setup Pages
uses: actions/configure-pages@v4