Commit 2458fc8 1 parent 31919f7 commit 2458fc8 Copy full SHA for 2458fc8
File tree 1 file changed +26
-27
lines changed
1 file changed +26
-27
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
+
2
3
on :
3
4
push :
4
5
branches :
7
8
jobs :
8
9
build :
9
10
name : Build and Deploy to Vercel
10
- runs-on : ubuntu-20.04
11
+ runs-on : ubuntu-latest
12
+
11
13
steps :
12
- - uses : actions/checkout@v2
14
+ # 检出代码
15
+ - name : Checkout code
16
+ uses : actions/checkout@v3
13
17
with :
14
18
fetch-depth : 0
15
19
16
- - uses : actions/setup-node@v2
20
+ # 设置 Node.js
21
+ - name : Setup Node.js
22
+ uses : actions/setup-node@v3
17
23
with :
18
- node-version : 16
19
- check-latest : true
20
-
21
- - name : Cache pnpm modules
22
- uses : actions/cache@v2
23
- with :
24
- path : ~/.pnpm-store
25
- key : ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
26
- restore-keys : |
27
- ${{ runner.os }}-pnpm-
28
-
24
+ node-version : 18
25
+ cache : ' pnpm'
26
+
27
+ # 安装 pnpm
29
28
- name : Setup pnpm
30
- uses : pnpm/action-setup@v2.4.0
29
+ uses : pnpm/action-setup@v2.2.4
31
30
with :
32
- version : 8.7.5 # 可以根据需要调整为最新的稳定版本
31
+ version : 8.7.5
33
32
33
+ # 安装依赖
34
34
- name : Install dependencies
35
35
run : pnpm install --frozen-lockfile --strict-peer-dependencies
36
- timeout-minutes : 10
37
36
37
+ # 生成代码
38
38
- name : Codegen
39
39
run : pnpm codegen
40
- timeout-minutes : 5
41
40
42
- - name : Test
41
+ # 运行测试
42
+ - name : Run tests
43
43
run : pnpm test
44
- timeout-minutes : 15
45
44
46
- - name : Build
45
+ # 构建项目
46
+ - name : Build project
47
47
run : pnpm build
48
- timeout-minutes : 15
49
48
49
+ # 部署到 Vercel(预发布环境)
50
50
- name : Deploy to Vercel (Staging)
51
51
if : ${{ github.ref != 'refs/heads/main' }}
52
52
uses : amondnet/vercel-action@v20
53
53
with :
54
54
vercel-token : ${{ secrets.VERCEL_TOKEN }}
55
55
vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
56
56
vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
57
- working-directory : ./dist
57
+ working-directory : ./
58
58
github-comment : false
59
- timeout-minutes : 5
60
59
60
+ # 部署到 Vercel(生产环境)
61
61
- name : Deploy to Vercel (Production)
62
62
if : ${{ github.ref == 'refs/heads/main' }}
63
63
uses : amondnet/vercel-action@v20
64
64
with :
65
65
vercel-token : ${{ secrets.VERCEL_TOKEN }}
66
66
vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
67
67
vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
68
- vercel-args : --prod
69
- working-directory : ./dist
68
+ vercel-args : ' --prod'
69
+ working-directory : ./
70
70
github-comment : false
71
- timeout-minutes : 5
You can’t perform that action at this time.
0 commit comments