Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Move Vercel deployment to GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
admdly committed Nov 22, 2023
1 parent 957668d commit de0a8c6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Vercel Deploy Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- main
pull_request:
branches:
- main

concurrency:
group: deploy-preview-${{ github.event.pull_request.head.sha || github.ref }}
cancel-in-progress: true

jobs:
deploy-preview:
name: Build and Deploy Preview
runs-on: ubuntu-latest
environment: Preview
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Vercel Deploy Production
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main

concurrency:
group: deploy-production

jobs:
deploy-production:
name: Build and Deploy Production
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- 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 }}
1 change: 1 addition & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"github": {
"enabled": false,
"silent": true
}
}

0 comments on commit de0a8c6

Please sign in to comment.