Skip to content

Commit d34330d

Browse files
committed
feat: add Vercel deployment workflow
- Introduced a GitHub Actions workflow for deploying to Vercel. - Configured separate jobs for preview and production deployments based on branch conditions. - Included steps for installing Vercel CLI, pulling environment information, building project artifacts, and deploying to Vercel.
1 parent db21f29 commit d34330d

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/vercel.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
push:
5+
6+
env:
7+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
8+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
9+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
10+
11+
jobs:
12+
preview:
13+
if: github.ref != 'refs/heads/main'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install Vercel CLI
18+
run: npm install --global vercel@latest
19+
- name: Pull Vercel Environment Information
20+
run: vercel pull --yes --environment=preview
21+
- name: Build Project Artifacts
22+
run: vercel build
23+
- name: Deploy Project Artifacts to Vercel
24+
run: vercel deploy --prebuilt
25+
26+
production:
27+
if: github.ref == 'refs/heads/main'
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Install Vercel CLI
32+
run: npm install --global vercel@latest
33+
- name: Pull Vercel Environment Information
34+
run: vercel pull --yes --environment=production
35+
- name: Build Project Artifacts
36+
run: vercel build --prod
37+
- name: Deploy Project Artifacts to Vercel
38+
run: vercel deploy --prebuilt --prod

0 commit comments

Comments
 (0)