Skip to content

Commit ccbf2e3

Browse files
committed
feat: add Vercel deployment workflow
1 parent 5903edc commit ccbf2e3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
push:
5+
branches:
6+
- main # 或者你的默认分支名
7+
workflow_dispatch: # 允许手动触发
8+
9+
env:
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 2
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Install Vercel CLI
31+
run: npm install --global vercel@latest
32+
33+
- name: Pull Vercel Environment Information
34+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
35+
36+
- name: Build Project Artifacts
37+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
38+
39+
- name: Deploy Project Artifacts to Vercel
40+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)