@@ -100,78 +100,31 @@ jobs:
100100 run : npm audit --audit-level=high
101101 continue-on-error : true
102102
103- # Deploy to Vercel (Production )
104- deploy-production :
105- name : Deploy to Production
103+ # Lighthouse Performance Check (on PR only )
104+ lighthouse :
105+ name : Lighthouse Performance Check
106106 runs-on : ubuntu-latest
107107 needs : [qa, build]
108- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
109- environment : production
108+ if : github.event_name == 'pull_request'
110109
111110 steps :
112111 - name : Checkout code
113112 uses : actions/checkout@v4
114113
115- - name : Download build artifacts
116- uses : actions/download-artifact@v4
117- with :
118- name : build-files
119- path : dist/
120-
121- - name : Deploy to Vercel
122- uses : amondnet/vercel-action@v25
114+ - name : Setup Node.js
115+ uses : actions/setup-node@v4
123116 with :
124- vercel-token : ${{ secrets.VERCEL_TOKEN }}
125- vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
126- vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
127- vercel-args : ' --prod'
117+ node-version : ${{ env.NODE_VERSION }}
118+ cache : ' npm'
128119
129- # Deploy to Vercel (Preview)
130- deploy-preview :
131- name : Deploy Preview
132- runs-on : ubuntu-latest
133- needs : [qa, build]
134- if : github.event_name == 'pull_request'
135-
136- steps :
137- - name : Checkout code
138- uses : actions/checkout@v4
120+ - name : Install dependencies
121+ run : npm ci
139122
140123 - name : Download build artifacts
141124 uses : actions/download-artifact@v4
142125 with :
143126 name : build-files
144127 path : dist/
145-
146- - name : Deploy Preview to Vercel
147- uses : amondnet/vercel-action@v25
148- with :
149- vercel-token : ${{ secrets.VERCEL_TOKEN }}
150- vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
151- vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
152-
153- - name : Comment PR with preview URL
154- uses : actions/github-script@v7
155- if : github.event_name == 'pull_request'
156- with :
157- script : |
158- github.rest.issues.createComment({
159- issue_number: context.issue.number,
160- owner: context.repo.owner,
161- repo: context.repo.repo,
162- body: '🚀 Preview deployment is ready! Check it out at the Vercel deployment URL.'
163- })
164-
165- # Lighthouse Performance Check
166- lighthouse :
167- name : Lighthouse Performance Check
168- runs-on : ubuntu-latest
169- needs : deploy-preview
170- if : github.event_name == 'pull_request'
171-
172- steps :
173- - name : Checkout code
174- uses : actions/checkout@v4
175128
176129 - name : Run Lighthouse CI
177130 uses : treosh/lighthouse-ci-action@v11
0 commit comments