Skip to content

Commit d02b0c6

Browse files
authored
ci: add Vercel deployment workflow (renamed)
Add automatic deployment workflow to Vercel. This workflow: - Runs on every push to main and on pull requests - Creates preview deployments for pull requests - Deploys to production when changes are merged to main - Uses Vercel for fast and efficient deployments Requires VERCEL_TOKEN, VERCEL_ORG_ID, and VERCEL_PROJECT_ID secrets to be configured.
1 parent 4e330d7 commit d02b0c6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
jobs:
10+
deploy:
11+
name: Deploy to Vercel
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
cache: 'npm'
21+
22+
# Deploy using Vercel Action
23+
- name: Deploy to Vercel
24+
uses: amondnet/vercel-action@v20
25+
with:
26+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
29+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
30+
working-directory: ./
31+
vercel-args: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && '--prod' || '' }}

0 commit comments

Comments
 (0)