Skip to content

Commit

Permalink
feat: vercel gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitkolhe committed Feb 18, 2024
1 parent 06729ec commit f6a9610
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
name: Preview Deployment
on:
push:
branches-ignore:
- main
branches:
- 'feat/*'
pull_request:
branches:
- 'feat/*'

jobs:
Deploy-Preview:
vercel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 }}
- name: Checkout Code
uses: actions/checkout@v2

- name: Cache Dependencies
uses: actions/cache@v1
with:
path: ~/.bun
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}
restore-keys: ${{ runner.os }}-bun-

- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Build
run: |
bun install
bun run build
- name: Deploy to Staging
id: deploy-vercel-staging
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_ORG_ID }}

0 comments on commit f6a9610

Please sign in to comment.