From 8639491ba221659f3c6084d7464418b57d9b04ca Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Thu, 16 Oct 2025 11:38:12 -0300 Subject: [PATCH] ci: fail on service restart errors to catch deployment issues --- .github/workflows/ci-cd-web-desktop.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index 761c11e..5b7bea7 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -234,14 +234,6 @@ jobs: echo "Heartbeat HTTP=$HB" if [ "$HB" != "200" ]; then echo "Heartbeat failed"; exit 1; fi - - name: Cleanup current build workdir - run: | - set -e - if [ -n "${EFFECTIVE_APP_DIR:-}" ] && [ -d "$EFFECTIVE_APP_DIR" ]; then - echo "Removing current build dir: $EFFECTIVE_APP_DIR" - rm -rf "$EFFECTIVE_APP_DIR" || echo "Failed to remove $EFFECTIVE_APP_DIR (will try old dirs next)" - fi - - name: Cleanup old build workdirs (keep last 2) run: | set -e @@ -260,11 +252,13 @@ jobs: - name: Restart web service with new code run: | - docker service update --force sistema_web || true + # Fail the job if the web service cannot restart + docker service update --force sistema_web - name: Restart Convex backend service (optional) run: | - docker service update --force sistema_convex_backend || true + # Fail the job if the convex backend cannot restart + docker service update --force sistema_convex_backend convex_deploy: name: Deploy Convex functions @@ -361,14 +355,6 @@ jobs: -e CONVEX_SELF_HOSTED_ADMIN_KEY \ node:20-bullseye bash -lc "set -euo pipefail; unset CONVEX_DEPLOYMENT; corepack enable; corepack prepare pnpm@9 --activate; pnpm install --frozen-lockfile --prod=false; pnpm exec convex deploy" - - name: Cleanup current build workdir (convex) - run: | - set -e - if [ -n "${EFFECTIVE_APP_DIR:-}" ] && [ -d "$EFFECTIVE_APP_DIR" ]; then - echo "Removing current build dir: $EFFECTIVE_APP_DIR" - rm -rf "$EFFECTIVE_APP_DIR" || echo "Failed to remove $EFFECTIVE_APP_DIR" - fi - - name: Cleanup old convex build workdirs (keep last 2) run: | set -e