-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.45 KB
/
vercel-deploy-tool.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 参考资料
# https://vercel.com/guides/how-can-i-use-github-actions-with-vercel
# https://vercel.com/guides/how-to-alias-a-preview-deployment-using-the-cli
name: 自写的vercel部署工具
env:
VERCEL_TOKEN: ${{ secrets.vercel_token }}
VERCEL_ORG_ID: ${{ secrets.vercel_orgId }}
VERCEL_PROJECT_ID: ${{ secrets.vercel_projectId }}
on:
push:
branches:
# 避免高频率占用vercel资源,改成仅在main分支执行部署行为
- main
# - dev-pause
# - dev
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- name: 检出分支
uses: actions/checkout@v4
- name: 安装pnpm
uses: pnpm/action-setup@v4
with:
# 项目提供了packageManager,故我们不提供该配置
# version: 9
run_install: |
- recursive: true
- args: [--global, "vercel", "@dotenvx/dotenvx", "tsx"]
- name: 安装node
uses: actions/setup-node@v4
with:
node-version: 22.6.0
cache: pnpm
- name: 检查版本
run: |
node -v
pnpm -v
vc -v
- name: pnpm全局检查依赖包
run: pnpm ls -g
- name: 运行自写的vercel部署工具
# https://dotenvx.com/docs/cis/github-actions#install-dotenvx
run: |
curl -sfS https://dotenvx.sh/install.sh | sh
pnpm dotenvx run -- node --import=tsx ./demos/vercel-deploy-tool/src/index.ts