From aeb7a8b6785be59cf8a0a4b293ff60298acdf17f Mon Sep 17 00:00:00 2001 From: codex Date: Wed, 11 Mar 2026 17:49:13 +0800 Subject: [PATCH] ci: check backend/frontend via docker status in runner container mode --- .gitea/workflows/deploy.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ab30bfb..77063e6 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -58,13 +58,14 @@ jobs: - name: Wait for backend health check run: | - echo "Waiting for backend to be healthy..." + echo "Waiting for backend container health=healthy..." for i in $(seq 1 30); do - if curl -sf http://127.0.0.1:18000/api/v1/utils/health-check/ > /dev/null 2>&1; then + status=$(docker inspect -f '{{.State.Health.Status}}' full-stack-fastapi-backend-1 2>/dev/null || echo "unknown") + if [ "$status" = "healthy" ]; then echo "✅ Backend is healthy!" exit 0 fi - echo "Attempt $i/30 - waiting 10s..." + echo "Attempt $i/30 - status=$status, waiting 10s..." sleep 10 done echo "❌ Backend health check failed after 300s" @@ -73,7 +74,7 @@ jobs: - name: Verify frontend run: | - if curl -sf http://127.0.0.1:3001 > /dev/null 2>&1; then + if docker compose --env-file .env.production -f compose.prod.yml ps frontend --status running | grep -q frontend; then echo "✅ Frontend is accessible!" else echo "❌ Frontend is not accessible"