fix: updates to CI/CD Paths
All checks were successful
Deploy to Staging / Build Images (push) Successful in 21s
Deploy to Staging / Deploy to Staging (push) Successful in 28s
Deploy to Staging / Verify Staging (push) Successful in 7s
Deploy to Staging / Notify Staging Ready (push) Successful in 6s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 21s
Deploy to Staging / Deploy to Staging (push) Successful in 28s
Deploy to Staging / Verify Staging (push) Successful in 7s
Deploy to Staging / Notify Staging Ready (push) Successful in 6s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
This commit is contained in:
@@ -145,7 +145,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check container status
|
||||
- name: Check container status and health
|
||||
run: |
|
||||
for service in mvp-frontend-staging mvp-backend-staging mvp-postgres-staging mvp-redis-staging; do
|
||||
status=$(docker inspect --format='{{.State.Status}}' $service 2>/dev/null || echo "not found")
|
||||
@@ -157,6 +157,36 @@ jobs:
|
||||
echo "OK: $service is running"
|
||||
done
|
||||
|
||||
# Wait for Docker healthchecks to complete (services with healthcheck defined)
|
||||
echo ""
|
||||
echo "Waiting for Docker healthchecks..."
|
||||
for service in mvp-frontend-staging mvp-backend-staging mvp-postgres-staging mvp-redis-staging; do
|
||||
# Check if service has a healthcheck defined
|
||||
has_healthcheck=$(docker inspect --format='{{if .Config.Healthcheck}}true{{else}}false{{end}}' $service 2>/dev/null || echo "false")
|
||||
if [ "$has_healthcheck" = "true" ]; then
|
||||
for i in 1 2 3 4 5 6 7 8 9 10; do
|
||||
health=$(docker inspect --format='{{.State.Health.Status}}' $service 2>/dev/null || echo "unknown")
|
||||
if [ "$health" = "healthy" ]; then
|
||||
echo "OK: $service is healthy"
|
||||
break
|
||||
elif [ "$health" = "unhealthy" ]; then
|
||||
echo "ERROR: $service is unhealthy"
|
||||
docker logs $service --tail 50 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
if [ $i -eq 10 ]; then
|
||||
echo "ERROR: $service health check timed out (status: $health)"
|
||||
docker logs $service --tail 50 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
echo "Waiting for $service healthcheck... (attempt $i/10, status: $health)"
|
||||
sleep 5
|
||||
done
|
||||
else
|
||||
echo "SKIP: $service has no healthcheck defined"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Wait for backend health
|
||||
run: |
|
||||
for i in 1 2 3 4 5 6; do
|
||||
|
||||
Reference in New Issue
Block a user