Vercel Preview Deploy #2
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 Preview Deploy | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
MONGODB_URI: ${{ secrets.MONGODB_URI }} | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- "master" | |
jobs: | |
if_merged: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Install Nest CLI | |
run: npm install --global @nestjs/cli@latest | |
- name: Deploy preview to Vercel | |
run: npm run deploy:preview |