File tree 2 files changed +43
-35
lines changed
2 files changed +43
-35
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to GitHub Pages
2
+
3
+ # 仅在推送到 main 分支时触发
4
+ on :
5
+ push :
6
+ branches :
7
+ - master # 当推送到 main 分支时触发 workflow
8
+ # 设置执行的工作
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : write
14
+ steps :
15
+ # 检查代码库
16
+ - name : Checkout code
17
+ uses : actions/checkout@v3
18
+
19
+ - name : Install pnpm
20
+ uses : pnpm/action-setup@v2
21
+
22
+ # 设置 Node.js 环境
23
+ - name : Set up Node.js
24
+ uses : actions/setup-node@v3
25
+ with :
26
+ node-version : lts/*
27
+ cache : pnpm
28
+
29
+ # 安装依赖
30
+ - name : Install dependencies
31
+ run : pnpm install --no-frozen-lockfile
32
+
33
+ # 运行 build 指令
34
+ - name : Run build
35
+ run : pnpm run build:dev
36
+
37
+ # 部署到 GitHub Pages
38
+ - name : Deploy to GitHub Pages
39
+ uses : peaceiris/actions-gh-pages@v3
40
+ with :
41
+ github_token : ${{ secrets.GH_TOKEN }}
42
+ # 部署 dist 目录中的内容
43
+ publish_dir : dist
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments