Skip to content

Commit cb0056c

Browse files
committed
Check book deployment before running vercel trigger
1 parent 3081301 commit cb0056c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ jobs:
267267
done
268268
269269
pre-check-vercel:
270+
needs: [deploy-to-book-server]
271+
if: always()
270272
runs-on: ubuntu-latest
271273
outputs:
272274
should_trigger: ${{ steps.check_vercel.outputs.should_trigger }}
@@ -283,6 +285,14 @@ jobs:
283285
run: |
284286
CONFIG_FILE="${{ inputs.config-file }}"
285287
288+
# Check if deploy-to-book-server ran and completed successfully
289+
DEPLOY_JOB_RESULT="${{ needs.deploy-to-book-server.result }}"
290+
if [ "$DEPLOY_JOB_RESULT" != "success" ]; then
291+
echo "deploy-to-book-server job did not complete successfully (result: $DEPLOY_JOB_RESULT). Skipping Vercel trigger."
292+
echo "should_trigger=false" >> $GITHUB_OUTPUT
293+
exit 0
294+
fi
295+
286296
if [ ! -f "$CONFIG_FILE" ] || ! jq -e 'has("vercel")' "$CONFIG_FILE" > /dev/null || ! jq -e '.vercel | has("trigger")' "$CONFIG_FILE" > /dev/null; then
287297
echo "No vercel trigger configuration found. Skipping."
288298
echo "should_trigger=false" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)