File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ name : 部署到GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
10+ pages : write
11+ id-token : write
12+
13+ jobs :
14+ build-and-deploy :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : 检出代码
18+ uses : actions/checkout@v4
19+
20+ - name : 设置Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : ' 18'
24+ cache : ' npm'
25+
26+ - name : 安装依赖
27+ run : npm ci
28+
29+ - name : 构建
30+ run : npm run build
31+
32+ - name : 部署到GitHub Pages
33+ uses : JamesIves/github-pages-deploy-action@v4
34+ with :
35+ folder : dist
36+ branch : gh-pages
37+ clean : true
Original file line number Diff line number Diff line change 77 "dev" : " vite" ,
88 "build" : " tsc -b && vite build" ,
99 "lint" : " eslint ." ,
10- "preview" : " vite preview"
10+ "preview" : " vite preview" ,
11+ "predeploy" : " npm run build" ,
12+ "deploy" : " gh-pages -d dist"
1113 },
1214 "dependencies" : {
1315 "@iconify/icons-carbon" : " ^1.2.20" ,
3234 "eslint" : " ^9.21.0" ,
3335 "eslint-plugin-react-hooks" : " ^5.1.0" ,
3436 "eslint-plugin-react-refresh" : " ^0.4.19" ,
37+ "gh-pages" : " ^6.1.1" ,
3538 "globals" : " ^15.15.0" ,
3639 "typescript" : " ~5.7.2" ,
3740 "typescript-eslint" : " ^8.24.1" ,
You can’t perform that action at this time.
0 commit comments