Skip to content

Commit 16504c3

Browse files
committed
2 parents ebbfc60 + cc791a4 commit 16504c3

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/vue-deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: write
13+
pages: write
14+
id-token: write
15+
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
# 设置 Node.js 22 环境
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
28+
# 安装依赖并构建
29+
- name: Install and build
30+
run: |
31+
npm install
32+
npm run build
33+
34+
# 上传构建产物
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: ./dist
39+
40+
# 部署到 GitHub Pages
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)