Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- master

jobs:
deploy:
Expand Down Expand Up @@ -34,7 +35,12 @@ jobs:
run: npm install -g vercel@latest

- name: Pull Vercel project settings
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
run: |
if [ "${{ github.ref_name }}" = "master" ]; then
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
else
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
fi
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
Expand All @@ -45,8 +51,16 @@ jobs:
cp -r doc_build .vercel/output/static
echo '{"version":3}' > .vercel/output/config.json

- name: Deploy to Vercel
- name: Deploy to Vercel (production)
if: github.ref_name == 'master'
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

- name: Deploy to Vercel (preview)
if: github.ref_name == 'main'
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
Loading