优化 GitHub Pages 部署配置,支持 master 分支,更新 Node.js 版本,调整构建命令,添加详细部署说明
This commit is contained in:
9
.github/workflows/deploy.yml
vendored
9
.github/workflows/deploy.yml
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user