Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Preview Deployment

on: workflow_dispatch

jobs:
deploy:
permissions:
contents: read

uses: ./.github/workflows/reusable-deploy-vercel.yml

secrets:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PROD Deployment

on:
workflow_dispatch:
push:
branches:
- main

jobs:
deploy:
permissions:
contents: read

uses: ./.github/workflows/reusable-deploy-vercel.yml

with:
PROD: true

secrets:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/reusable-deploy-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Vercel Deployment (reusable)

on:
workflow_call:
inputs:
PROD:
required: false
type: boolean
default: false
secrets:
VERCEL_ORG_ID:
required: true
VERCEL_PROJECT_ID:
required: true
VERCEL_TOKEN:
required: true

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ENVIRONMENT: ${{ inputs.PROD == true && 'production' || 'preview' }}
VERCEL_CLI_ENV_FLAG: ${{ inputs.PROD == true && '--prod' || '' }}

jobs:
deploy:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
run: npm install -g pnpm

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=${{ env.VERCEL_ENVIRONMENT }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build ${{ env.VERCEL_CLI_ENV_FLAG }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy ${{ env.VERCEL_CLI_ENV_FLAG }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
7 changes: 7 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"git": {
"deploymentEnabled": {
"main": false
}
}
}