Skip to content

Commit c47aaae

Browse files
committed
fix vercel backend trigger
1 parent e423c12 commit c47aaae

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

‎.github/workflows/deploy-vercel-backend.yml‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Vercel Backend CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
paths:
77
- 'apps/api/**'
88
- 'packages/shared/**'
@@ -14,4 +14,20 @@ jobs:
1414
steps:
1515
- name: Trigger Vercel Deploy
1616
run: |
17-
curl -X POST "https://api.vercel.com/v1/integrations/deploy/${{ secrets.VERCEL_NEST_DEPLOY_HOOK }}"
17+
response=$(curl -s -w "\n%{http_code}" -X POST \
18+
-H "Content-Type: application/json" \
19+
-d '{}' \
20+
"https://api.vercel.com/v1/integrations/deploy/${{ secrets.VERCEL_NEST_DEPLOY_HOOK }}")
21+
22+
http_code=$(echo "$response" | tail -n1)
23+
body=$(echo "$response" | sed '$d')
24+
25+
echo "Response: $body"
26+
echo "HTTP Code: $http_code"
27+
28+
if [ "$http_code" -ne 200 ] && [ "$http_code" -ne 201 ]; then
29+
echo "::error::Deploy hook failed with status $http_code"
30+
exit 1
31+
fi
32+
33+
echo "✅ Deploy triggered successfully"

0 commit comments

Comments
 (0)