ci: add shared manual Vercel deployment
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
name: Deploy to Vercel
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
environment:
|
||||||
|
description: Deployment environment
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- preview
|
||||||
|
- production
|
||||||
|
default: preview
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||||
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||||
|
DEPLOY_ENV: ${{ inputs.environment }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
npm install --global vercel@59.17.0
|
||||||
|
if [ "$DEPLOY_ENV" = production ]; then PROD=--prod; else PROD=; fi
|
||||||
|
vercel pull --yes --environment="$DEPLOY_ENV" --token="${{ secrets.VERCEL_TOKEN }}"
|
||||||
|
vercel build $PROD --token="${{ secrets.VERCEL_TOKEN }}"
|
||||||
|
vercel deploy --prebuilt --archive=tgz $PROD --token="${{ secrets.VERCEL_TOKEN }}"
|
||||||
Reference in New Issue
Block a user