From 8495fe5f1f772ce448d1f0378e1d0f5176b721f6 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 22 Feb 2026 01:51:31 -0800 Subject: [PATCH] ci: rename ssh workflow and enforce web/scheduler runtime checks --- ...loy-dokploy.yml => deploy-ssh-compose.yml} | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) rename .gitea/workflows/{deploy-dokploy.yml => deploy-ssh-compose.yml} (71%) diff --git a/.gitea/workflows/deploy-dokploy.yml b/.gitea/workflows/deploy-ssh-compose.yml similarity index 71% rename from .gitea/workflows/deploy-dokploy.yml rename to .gitea/workflows/deploy-ssh-compose.yml index e9e1ac8..3eb124f 100644 --- a/.gitea/workflows/deploy-dokploy.yml +++ b/.gitea/workflows/deploy-ssh-compose.yml @@ -85,14 +85,45 @@ jobs: ssh "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ "cd '$DEPLOY_PATH' && IMAGE_TAG='$IMAGE_TAG' docker compose pull && IMAGE_TAG='$IMAGE_TAG' docker compose up -d --remove-orphans && docker image prune -f" + - name: Verify Web and Scheduler Are Running + run: | + set -euo pipefail + ssh "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" "DEPLOY_PATH='$DEPLOY_PATH' bash -s" << 'EOF' + set -euo pipefail + cd "$DEPLOY_PATH" + web_id="$(docker compose ps -q web)" + scheduler_id="$(docker compose ps -q scheduler)" + + if [ -z "$web_id" ]; then + echo "web service container not found" + exit 1 + fi + if [ -z "$scheduler_id" ]; then + echo "scheduler service container not found" + exit 1 + fi + + web_running="$(docker inspect -f '{{.State.Running}}' "$web_id")" + scheduler_running="$(docker inspect -f '{{.State.Running}}' "$scheduler_id")" + + if [ "$web_running" != "true" ]; then + echo "web service is not running" + exit 1 + fi + if [ "$scheduler_running" != "true" ]; then + echo "scheduler service is not running" + exit 1 + fi + EOF + - name: Wait for Ready Health Check env: - HEALTH_URL: ${{ secrets.DOKPLOY_HEALTHCHECK_URL }} + HEALTH_URL: ${{ secrets.DEPLOY_HEALTHCHECK_URL }} MAX_ATTEMPTS: "30" SLEEP_SECONDS: "10" run: | if [ -z "$HEALTH_URL" ]; then - echo "Missing DOKPLOY_HEALTHCHECK_URL secret" + echo "Missing DEPLOY_HEALTHCHECK_URL secret" exit 1 fi bash scripts/wait-for-health.sh