Skip to content

Commit 713205c

Browse files
committed
Add GitHub Actions workflow for frontend deployment to Vercel
Set up automated deployment pipeline that triggers on pull requests to develop branch when client/ directory changes. Includes Node.js 20 setup, yarn dependency installation, build process, and Vercel deployment.
1 parent 99b0342 commit 713205c

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy Frontend to Vercel
2+
3+
on:
4+
pull_request:
5+
branches: [develop]
6+
paths: ['client/**']
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'yarn'
24+
cache-dependency-path: client/yarn.lock
25+
26+
- name: Install dependencies
27+
run: |
28+
cd client
29+
yarn install --frozen-lockfile
30+
31+
- name: Build project
32+
run: |
33+
cd client
34+
yarn build
35+
36+
- name: Deploy to Vercel
37+
id: vercel-deploy
38+
uses: amondnet/vercel-action@v25
39+
with:
40+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
41+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
42+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
43+
working-directory: ./client
44+
scope: ${{ secrets.VERCEL_ORG_ID }}
45+
46+
- name: Comment PR
47+
if: github.event_name == 'pull_request'
48+
uses: actions/github-script@v7
49+
with:
50+
script: |
51+
const deployUrl = '${{ steps.vercel-deploy.outputs.preview-url }}';
52+
github.rest.issues.createComment({
53+
issue_number: context.issue.number,
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
body: `🚀 **Frontend deployed successfully!**\n\n📱 **Preview URL:** ${deployUrl || 'Deployment in progress...'}\n\n✅ Build completed successfully`
57+
});

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@ __debug_bin
313313
.dockerignore
314314

315315
CLAUDE.md
316+
.vercel

0 commit comments

Comments
 (0)