Skip to content

Commit 8a176b2

Browse files
author
Deepak Pandey
committed
FIX: Simplify Vercel deployment by removing linking step
- Remove vercel link command that was causing project settings errors - Use direct deployment with --project flag to specify project ID - Eliminate the need for pre-linking by deploying directly - Clean up .vercel directory before each deployment - Simplified and more reliable deployment process for both staging and production
1 parent 8f32260 commit 8a176b2

1 file changed

Lines changed: 6 additions & 20 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -262,19 +262,12 @@ jobs:
262262
- name: Install Vercel CLI
263263
run: npm install -g vercel@latest
264264

265-
- name: Link Vercel Project
265+
- name: Deploy to Vercel (Staging)
266266
run: |
267267
# Remove any existing .vercel directory to avoid conflicts
268268
rm -rf .vercel
269-
# Link the project using Vercel CLI
270-
vercel link --token ${{ secrets.VERCEL_TOKEN }} --yes --project ${{ secrets.VERCEL_PROJECT_ID }}
271-
env:
272-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
273-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
274-
275-
- name: Deploy to Vercel (Staging)
276-
run: |
277-
vercel --token ${{ secrets.VERCEL_TOKEN }} --yes
269+
# Deploy directly with project ID (no linking required)
270+
vercel --token ${{ secrets.VERCEL_TOKEN }} --yes --project ${{ secrets.VERCEL_PROJECT_ID }}
278271
env:
279272
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
280273
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
@@ -304,19 +297,12 @@ jobs:
304297
- name: Install Vercel CLI
305298
run: npm install -g vercel@latest
306299

307-
- name: Link Vercel Project
300+
- name: Deploy to Vercel (Production)
308301
run: |
309302
# Remove any existing .vercel directory to avoid conflicts
310303
rm -rf .vercel
311-
# Link the project using Vercel CLI
312-
vercel link --token ${{ secrets.VERCEL_TOKEN }} --yes --project ${{ secrets.VERCEL_PROJECT_ID }}
313-
env:
314-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
315-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
316-
317-
- name: Deploy to Vercel (Production)
318-
run: |
319-
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes
304+
# Deploy directly with project ID (no linking required)
305+
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes --project ${{ secrets.VERCEL_PROJECT_ID }}
320306
env:
321307
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
322308
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

0 commit comments

Comments
 (0)