更新 Vercel 部署工作流,直接使用 vercel CLI 部署

This commit is contained in:
2025-11-09 15:23:20 +08:00
parent 6bb01c3726
commit f215aaab2c

View File

@@ -5,20 +5,6 @@ on:
branches: branches:
- docs - docs
workflow_dispatch: workflow_dispatch:
inputs:
environment:
description: "部署环境"
required: false
default: "production"
type: choice
options:
- production
- preview
force_rebuild:
description: "强制重新构建"
required: false
type: boolean
default: false
jobs: jobs:
vercel-deploy: vercel-deploy:
@@ -44,11 +30,11 @@ jobs:
run: pnpm run docs:build run: pnpm run docs:build
- name: Deploy to Vercel - name: Deploy to Vercel
uses: amondnet/vercel-action@v25 run: |
with: npm install -g vercel
vercel-token: ${{ secrets.VERCEL_TOKEN }} vercel deploy --prod \
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} --token ${{ secrets.VERCEL_TOKEN }} \
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} --build-env VUEPRESS_BASE=/
vercel-args: ${{ github.event.inputs.environment == 'preview' && '--' || '--prod' }}
env: env:
FORCE_REBUILD: ${{ github.event.inputs.force_rebuild }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}