Skip to content

[Dispatch] Preview Deploy with Vercel #118

[Dispatch] Preview Deploy with Vercel

[Dispatch] Preview Deploy with Vercel #118

name: "[Dispatch] Preview Deploy with Vercel"
on:
workflow_dispatch:
inputs:
project:
description: 'Enter Vercel project name'
required: true
default: 'feedback'
env:
TEAM_NAME: ${{ vars.VERCEL_TEAM_NAME }}
PROJECT_NAME: ${{ github.event.inputs.project }}
VERCEL_TOKEN: ${{ secrets.VERCEL_CLOUDFORET_TOKEN }}
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- name: Checkout code and submodules
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Set up environment
run: sudo apt-get install jq
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Checkout Vercel Target Project
run: vercel link --yes --scope=${{ env.TEAM_NAME }} --project=${{ env.PROJECT_NAME }} --token=${{ env.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information
run: vercel pull --yes --token=${{ env.VERCEL_TOKEN }}
- name: Pull Vercel Edge Config
run: vercel env pull ./apps/web/.env --yes --token=${{ env.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --yes --token=${{ env.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ env.VERCEL_TOKEN }}