Skip to content

Commit

Permalink
Add a GitHub Action to deploy on Vercel (#100)
Browse files Browse the repository at this point in the history
The action will deploy on Vercel, only for the main branch and when changes are detected in frontend/.
  • Loading branch information
bpierre authored Apr 7, 2024
1 parent 1694b46 commit 8807eae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/vercel-deployment-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy the main branch to Vercel
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches: ['main']
paths: ['frontend/**']
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Install Vercel CLI
run: pnpm install --global vercel@canary
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
8 changes: 8 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"framework": null,
"buildCommand": "",
"public": false,
"github": {
"enabled": false
}
}

0 comments on commit 8807eae

Please sign in to comment.