ci: fail on service restart errors to catch deployment issues
This commit is contained in:
parent
c785094e4f
commit
8639491ba2
1 changed files with 4 additions and 18 deletions
22
.github/workflows/ci-cd-web-desktop.yml
vendored
22
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -234,14 +234,6 @@ jobs:
|
||||||
echo "Heartbeat HTTP=$HB"
|
echo "Heartbeat HTTP=$HB"
|
||||||
if [ "$HB" != "200" ]; then echo "Heartbeat failed"; exit 1; fi
|
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)
|
- name: Cleanup old build workdirs (keep last 2)
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -260,11 +252,13 @@ jobs:
|
||||||
|
|
||||||
- name: Restart web service with new code
|
- name: Restart web service with new code
|
||||||
run: |
|
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)
|
- name: Restart Convex backend service (optional)
|
||||||
run: |
|
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:
|
convex_deploy:
|
||||||
name: Deploy Convex functions
|
name: Deploy Convex functions
|
||||||
|
|
@ -361,14 +355,6 @@ jobs:
|
||||||
-e CONVEX_SELF_HOSTED_ADMIN_KEY \
|
-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"
|
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)
|
- name: Cleanup old convex build workdirs (keep last 2)
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue