🐎 ci: 安装整个项目的依赖 #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 自主实现简单的vercel-cil部署 | |
env: | |
vercel-token: ${{ secrets.vercel_token }} | |
vercel-org-id: ${{ secrets.vercel_orgId}} | |
vercel-project-id: ${{ secrets.vercel_projectId}} | |
on: | |
push: | |
branches: | |
- dev | |
# 参考资料 | |
# 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 | |
jobs: | |
Deploy-Production: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: 开启 corepack | |
run: corepack enable && corepack install | |
- name: 检查pnpm版本 | |
run: pnpm -v | |
- name: 安装整个项目的依赖 | |
run: pnpm i | |
- name: 用npm安装vercel cli工具 | |
run: | | |
npm i -g vercel@latest | |
- name: 检查vercel cli版本 | |
run: vercel -v | |
- name: 拉取vercel环境变量 | |
run: vercel pull --yes --environment=production --token=${{ secrets.vercel_token }} | |
- name: 打包monorepo-3 | |
run: vercel build --yes --cwd ./ --local-config ./packages/monorepo-3/vercel.json --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: 部署到vercel内 | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |