We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f28c60 commit 341431dCopy full SHA for 341431d
.github/workflows/deploy.yml
@@ -0,0 +1,35 @@
1
+name: Deploy to GitHub Pages
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - main # 每次推送到main分支时触发
7
8
+jobs:
9
+ build-and-deploy:
10
+ runs-on: ubuntu-latest
11
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v3
15
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: '16'
20
+ cache: 'npm'
21
22
+ - name: Install dependencies
23
+ run: npm ci
24
25
+ - name: Build project
26
+ run: npm run build
27
+ env:
28
+ CI: false # 避免将警告视为错误
29
30
+ - name: Deploy to GitHub Pages
31
+ uses: JamesIves/github-pages-deploy-action@v4
32
33
+ folder: build # 构建输出的文件夹
34
+ branch: gh-pages # 部署的目标分支
35
+ clean: true # 清理旧文件
0 commit comments