Skip to content

Commit 77bd2b5

Browse files
committed
Github Action
1 parent 8daa793 commit 77bd2b5

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Vercel Deploy
2+
3+
env:
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
deploy-preview:
17+
if: github.event_name == 'pull_request'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v2
24+
25+
- name: Install Vercel CLI
26+
run: bun install -g vercel
27+
28+
- name: Pull Vercel Environment
29+
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
30+
31+
- name: Build Project
32+
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
33+
34+
- name: Deploy to Vercel (Preview)
35+
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
36+
37+
deploy-production:
38+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Bun
44+
uses: oven-sh/setup-bun@v2
45+
46+
- name: Install Vercel CLI
47+
run: bun install -g vercel
48+
49+
- name: Pull Vercel Environment
50+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
51+
52+
- name: Build Project
53+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
54+
55+
- name: Deploy to Vercel (Production)
56+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)