File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-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 # 当推送到main分支时触发
7
+ # 允许手动触发工作流
8
+ workflow_dispatch :
9
+
10
+ # 权限设置
11
+ permissions :
12
+ contents : write
13
+
14
+ jobs :
15
+ build-and-deploy :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Checkout 🛎️
19
+ uses : actions/checkout@v3
20
+
21
+ - name : Setup Node.js 🔧
22
+ uses : actions/setup-node@v3
23
+ with :
24
+ node-version : ' 18'
25
+ cache : ' npm'
26
+ cache-dependency-path : ' ./script-hook-website/package-lock.json'
27
+
28
+ - name : Install Dependencies 📦
29
+ run : |
30
+ cd script-hook-website
31
+ npm ci
32
+
33
+ - name : Build 🏗️
34
+ run : |
35
+ cd script-hook-website
36
+ npm run build
37
+
38
+ - name : Deploy 🚀
39
+ uses : JamesIves/github-pages-deploy-action@v4
40
+ with :
41
+ folder : script-hook-website/dist # 要部署的文件夹
42
+ branch : gh-pages # 部署到的分支
43
+ clean : true # 在部署前清理目标分支
You can’t perform that action at this time.
0 commit comments