Skip to content

Commit 2458fc8

Browse files
committed
测试
1 parent 31919f7 commit 2458fc8

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

.github/workflows/ci.yml

+26-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
23
on:
34
push:
45
branches:
@@ -7,65 +8,63 @@ on:
78
jobs:
89
build:
910
name: Build and Deploy to Vercel
10-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
12+
1113
steps:
12-
- uses: actions/checkout@v2
14+
# 检出代码
15+
- name: Checkout code
16+
uses: actions/checkout@v3
1317
with:
1418
fetch-depth: 0
1519

16-
- uses: actions/setup-node@v2
20+
# 设置 Node.js
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
1723
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
2928
- name: Setup pnpm
30-
uses: pnpm/action-setup@v2.4.0
29+
uses: pnpm/action-setup@v2.2.4
3130
with:
32-
version: 8.7.5 # 可以根据需要调整为最新的稳定版本
31+
version: 8.7.5
3332

33+
# 安装依赖
3434
- name: Install dependencies
3535
run: pnpm install --frozen-lockfile --strict-peer-dependencies
36-
timeout-minutes: 10
3736

37+
# 生成代码
3838
- name: Codegen
3939
run: pnpm codegen
40-
timeout-minutes: 5
4140

42-
- name: Test
41+
# 运行测试
42+
- name: Run tests
4343
run: pnpm test
44-
timeout-minutes: 15
4544

46-
- name: Build
45+
# 构建项目
46+
- name: Build project
4747
run: pnpm build
48-
timeout-minutes: 15
4948

49+
# 部署到 Vercel(预发布环境)
5050
- name: Deploy to Vercel (Staging)
5151
if: ${{ github.ref != 'refs/heads/main' }}
5252
uses: amondnet/vercel-action@v20
5353
with:
5454
vercel-token: ${{ secrets.VERCEL_TOKEN }}
5555
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
5656
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
57-
working-directory: ./dist
57+
working-directory: ./
5858
github-comment: false
59-
timeout-minutes: 5
6059

60+
# 部署到 Vercel(生产环境)
6161
- name: Deploy to Vercel (Production)
6262
if: ${{ github.ref == 'refs/heads/main' }}
6363
uses: amondnet/vercel-action@v20
6464
with:
6565
vercel-token: ${{ secrets.VERCEL_TOKEN }}
6666
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
6767
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
68-
vercel-args: --prod
69-
working-directory: ./dist
68+
vercel-args: '--prod'
69+
working-directory: ./
7070
github-comment: false
71-
timeout-minutes: 5

0 commit comments

Comments
 (0)