Skip to content

Commit f109081

Browse files
authored
Merge pull request #208 from codeunia-dev/production-readiness-improvements
fix: Use direct --scope flag for Vercel deployment instead of .vercel…
2 parents c8bf235 + 08ba444 commit f109081

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

.github/workflows/ci-cd.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,8 @@ jobs:
266266
run: |
267267
# Remove any existing .vercel directory to avoid conflicts
268268
rm -rf .vercel
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
272-
# Deploy to staging
273-
vercel --token ${{ secrets.VERCEL_TOKEN }} --yes
269+
# Deploy directly using scope and project flags
270+
vercel --token ${{ secrets.VERCEL_TOKEN }} --scope ${{ secrets.VERCEL_ORG_ID }} --yes
274271
env:
275272
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
276273
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
@@ -304,11 +301,8 @@ jobs:
304301
run: |
305302
# Remove any existing .vercel directory to avoid conflicts
306303
rm -rf .vercel
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
310-
# Deploy to production
311-
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes
304+
# Deploy directly using scope and project flags
305+
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --scope ${{ secrets.VERCEL_ORG_ID }} --yes
312306
env:
313307
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
314308
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
@@ -338,11 +332,10 @@ jobs:
338332

339333
- name: Rollback deployment
340334
run: |
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
344-
# Perform rollback
345-
vercel rollback --token ${{ secrets.VERCEL_TOKEN }} --yes
335+
# Remove any existing .vercel directory to avoid conflicts
336+
rm -rf .vercel
337+
# Perform rollback using scope flag
338+
vercel rollback --token ${{ secrets.VERCEL_TOKEN }} --scope ${{ secrets.VERCEL_ORG_ID }} --yes
346339
env:
347340
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
348341
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

scripts/test-ci-local.sh

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

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"
104-
105-
# Test deployment command structure
106-
print_status "Testing Vercel deployment command structure..."
107-
echo "vercel --token \$VERCEL_TOKEN --yes"
108-
echo "vercel --prod --token \$VERCEL_TOKEN --yes"
100+
# Test direct deployment with scope flag
101+
print_status "Testing Vercel direct deployment with scope flag..."
102+
echo "vercel --token \$VERCEL_TOKEN --scope \$VERCEL_ORG_ID --yes"
103+
echo "vercel --prod --token \$VERCEL_TOKEN --scope \$VERCEL_ORG_ID --yes"
109104

110105
print_success "Vercel command testing completed!"
111106
}

0 commit comments

Comments
 (0)