Skip to content

Commit c8bf235

Browse files
authored
Merge pull request #207 from codeunia-dev/production-readiness-improvements
fix: Resolve Vercel project linking issues in CI/CD pipeline
2 parents 8c4dbbc + c222215 commit c8bf235

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/ci-cd.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ jobs:
266266
run: |
267267
# Remove any existing .vercel directory to avoid conflicts
268268
rm -rf .vercel
269-
# Link project using environment variables
270-
vercel link --token ${{ secrets.VERCEL_TOKEN }} --yes
269+
# Create .vercel directory with project configuration
270+
mkdir -p .vercel
271+
echo '{"orgId":"${{ secrets.VERCEL_ORG_ID }}","projectId":"${{ secrets.VERCEL_PROJECT_ID }}"}' > .vercel/project.json
271272
# Deploy to staging
272273
vercel --token ${{ secrets.VERCEL_TOKEN }} --yes
273274
env:
@@ -303,8 +304,9 @@ jobs:
303304
run: |
304305
# Remove any existing .vercel directory to avoid conflicts
305306
rm -rf .vercel
306-
# Link project using environment variables
307-
vercel link --token ${{ secrets.VERCEL_TOKEN }} --yes
307+
# Create .vercel directory with project configuration
308+
mkdir -p .vercel
309+
echo '{"orgId":"${{ secrets.VERCEL_ORG_ID }}","projectId":"${{ secrets.VERCEL_PROJECT_ID }}"}' > .vercel/project.json
308310
# Deploy to production
309311
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes
310312
env:
@@ -336,8 +338,9 @@ jobs:
336338

337339
- name: Rollback deployment
338340
run: |
339-
# Link project using environment variables
340-
vercel link --token ${{ secrets.VERCEL_TOKEN }} --yes
341+
# Create .vercel directory with project configuration
342+
mkdir -p .vercel
343+
echo '{"orgId":"${{ secrets.VERCEL_ORG_ID }}","projectId":"${{ secrets.VERCEL_PROJECT_ID }}"}' > .vercel/project.json
341344
# Perform rollback
342345
vercel rollback --token ${{ secrets.VERCEL_TOKEN }} --yes
343346
env:

scripts/test-ci-local.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ test_vercel_commands() {
9797
print_status "Vercel CLI version:"
9898
vercel --version
9999

100-
# Test linking (this will fail with dummy secrets, but we can see the command structure)
101-
print_status "Testing Vercel link command structure..."
102-
echo "vercel link --token \$VERCEL_TOKEN --yes"
100+
# Test project configuration creation
101+
print_status "Testing Vercel project configuration creation..."
102+
echo "mkdir -p .vercel"
103+
echo "echo '{\"orgId\":\"\$VERCEL_ORG_ID\",\"projectId\":\"\$VERCEL_PROJECT_ID\"}' > .vercel/project.json"
103104

104105
# Test deployment command structure
105106
print_status "Testing Vercel deployment command structure..."

0 commit comments

Comments
 (0)