File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ name: Deploy to GitHub Pages
2+
3+ on:
4+ push:
5+ branches:
6+ - main # 或者 master,取决于你的主分支名称
7+
8+ permissions:
9+ contents: write
10+
11+ jobs:
12+ build-and-deploy:
13+ runs-on: ubuntu-latest
14+ steps:
15+ - name: Checkout
16+ uses: actions/checkout@v4
17+
18+ - name: Setup Node.js
19+ uses: actions/setup-node@v4
20+ with:
21+ node-version: '20'
22+ cache: 'npm'
23+
24+ - name: Install Dependencies
25+ run: npm ci
26+
27+ - name: Build
28+ run: npm run build-only
29+
30+ - name: Deploy to GitHub Pages
31+ uses: JamesIves/github-pages-deploy-action@v4
32+ with:
33+ folder: dist # Vite 构建输出目录
34+ branch: gh-pages # 部署分支
Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main # 或者 master,取决于你的主分支名称
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build-and-deploy :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20'
22+ cache : ' npm'
23+
24+ - name : Install Dependencies
25+ run : npm ci
26+
27+ - name : Build
28+ run : npm run build-only
29+
30+ - name : Deploy to GitHub Pages
31+ uses : JamesIves/github-pages-deploy-action@v4
32+ with :
33+ folder : dist # Vite 构建输出目录
34+ branch : gh-pages # 部署分支
You can’t perform that action at this time.
0 commit comments