Skip to content

Commit 63d7da5

Browse files
committed
fix: add better error handling and debugging to CI
- Add error capture and reporting for wrangler deploy - Add debug step to verify environment and files - Don't immediately exit on error to capture output This will help diagnose why the deployment is failing in CI. Signed-off-by: Mark Phelps <[email protected]>
1 parent ac703ae commit 63d7da5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/worker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,40 @@ jobs:
2828
working-directory: ./worker
2929
run: npm install
3030

31+
- name: Debug - List worker files
32+
working-directory: ./worker
33+
run: |
34+
echo "Current directory:"
35+
pwd
36+
echo "Files in worker directory:"
37+
ls -la
38+
echo "Node version:"
39+
node --version
40+
echo "NPM version:"
41+
npm --version
42+
echo "Wrangler version:"
43+
npx wrangler --version
44+
3145
# Deploy preview
3246
- name: Deploy Worker Preview
3347
id: deploy
3448
working-directory: ./worker
3549
run: |
3650
# Deploy the worker to preview environment
51+
echo "Starting deployment..."
52+
set +e # Don't exit immediately on error
3753
OUTPUT=$(npx wrangler deploy --config wrangler.jsonc --env preview 2>&1)
54+
EXIT_CODE=$?
55+
set -e # Re-enable exit on error
56+
57+
echo "Deployment output:"
3858
echo "$OUTPUT"
3959
60+
if [ $EXIT_CODE -ne 0 ]; then
61+
echo "Deployment failed with exit code $EXIT_CODE"
62+
exit $EXIT_CODE
63+
fi
64+
4065
# Extract the deployed URL from the output
4166
# Look for the worker URL pattern
4267
PREVIEW_URL=$(echo "$OUTPUT" | grep -o 'https://docs-preview[^[:space:]]*' | head -1)

0 commit comments

Comments
 (0)