Skip to content

Commit 94ad837

Browse files
committed
ci add action workflow
1 parent 86e4741 commit 94ad837

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
name: Deploy to GitHub Pages
22

33
on:
4+
# Runs on pushes targeting the default branch
45
push:
5-
branches:
6-
- main # 或者 master,取决于你的主分支名称
6+
branches: ['main']
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
710

811
permissions:
912
contents: write
1013

14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: 'pages'
18+
cancel-in-progress: false
19+
1120
jobs:
1221
build-and-deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
1325
runs-on: ubuntu-latest
1426
steps:
1527
- name: Checkout
@@ -27,8 +39,15 @@ jobs:
2739
- name: Build
2840
run: npm run build-only
2941

30-
- name: Deploy to GitHub Pages
31-
uses: JamesIves/github-pages-deploy-action@v4
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v5
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
3247
with:
33-
folder: dist # Vite 构建输出目录
34-
branch: gh-pages # 部署分支
48+
# Upload entire repository
49+
path: './dist'
50+
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)