Skip to content

Commit

Permalink
Merge pull request #260 from wildan3105/ci/healthcheck
Browse files Browse the repository at this point in the history
ci: add healthcheck before concluding deployment
  • Loading branch information
wildan3105 authored Oct 31, 2024
2 parents f733809 + 7855524 commit 9622700
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,17 @@ jobs:
# Verify that the symlink points to the latest deployment
echo "Deployment verification:"
ls -l $SYMLINK
# delay before performing healthcheck
sleep 10s
# perform healthcheck
echo "Performing health check on http://localhost:5000..."
STATUS_CODE=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:5000)
if [ "$STATUS_CODE" -ne 200 ]; then
echo "Health check failed with status code: $STATUS_CODE"
exit 1
else
echo "Health check passed with status code: $STATUS_CODE"
fi

0 comments on commit 9622700

Please sign in to comment.