Fix workflow health check: docker inspect instead of localhost curl (runner can't reach host's localhost)
Build & Deploy / build-and-deploy (push) Successful in 15s

This commit is contained in:
David Alvarez
2026-05-25 13:49:42 +02:00
parent 8c1be9db03
commit b8cc11caf4
+13 -11
View File
@@ -44,18 +44,20 @@ jobs:
-e TWITCH_CLIENT_SECRET='${{ secrets.TWITCH_CLIENT_SECRET }}' \
${{ env.IMAGE_NAME }}:latest
- name: Wait for health check
- name: Verify container is running
run: |
for i in $(seq 1 30); do
if curl -sf http://localhost:${{ env.HOST_PORT }}/api/health >/dev/null 2>&1; then
echo "✅ Dostalgia is running!"
exit 0
fi
sleep 2
done
echo "❌ Health check failed"
docker logs ${{ env.CONTAINER_NAME }} --tail 20
exit 1
sleep 5
STATUS=$(docker inspect -f '{{.State.Status}}' ${{ env.CONTAINER_NAME }})
if [ "$STATUS" = "running" ]; then
echo "✅ Dostalgia container is running"
echo "--- last logs ---"
docker logs ${{ env.CONTAINER_NAME }} --tail 5
echo "✅ Dostalgia deployed!"
else
echo "❌ Container status: $STATUS"
docker logs ${{ env.CONTAINER_NAME }} --tail 30
exit 1
fi
- name: Clean up old images
run: docker image prune -f --filter "until=24h"