diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ae32a0..e8d94ad 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,9 +35,16 @@ jobs: - name: Deploy containers run: | cd /home/deployer/api-ubigeo - docker compose -f docker-compose.production.yml up -d --remove-orphans + docker compose -f docker-compose.production.yml down --remove-orphans + docker compose -f docker-compose.production.yml up -d - name: Health check run: | - sleep 10 - curl -f https://api-ubigeo.darkcodex.dev/api/v1/health + sleep 15 + STATUS=$(wget -qO- http://127.0.0.1:3200/api/v1/health || echo "fail") + echo "Internal health: $STATUS" + if echo "$STATUS" | grep -q "ok"; then + echo "API is up" + else + echo "API health check failed" && exit 1 + fi