Skip to content

Commit 9622700

Browse files
authored
Merge pull request #260 from wildan3105/ci/healthcheck
ci: add healthcheck before concluding deployment
2 parents f733809 + 7855524 commit 9622700

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,17 @@ jobs:
7373
# Verify that the symlink points to the latest deployment
7474
echo "Deployment verification:"
7575
ls -l $SYMLINK
76+
77+
# delay before performing healthcheck
78+
sleep 10s
79+
80+
# perform healthcheck
81+
echo "Performing health check on http://localhost:5000..."
82+
STATUS_CODE=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:5000)
83+
84+
if [ "$STATUS_CODE" -ne 200 ]; then
85+
echo "Health check failed with status code: $STATUS_CODE"
86+
exit 1
87+
else
88+
echo "Health check passed with status code: $STATUS_CODE"
89+
fi

0 commit comments

Comments
 (0)