Compare commits

...

2 Commits

Author SHA1 Message Date
Admin
1f987be75a feat: optimize prod deployment to avoid unnecessary container restarts
Some checks failed
Release / Test backend (push) Successful in 1m7s
Release / Test UI (push) Successful in 1m29s
Release / Build and push images (push) Successful in 4m30s
Release / Deploy to prod (push) Failing after 19s
Release / Deploy to homelab (push) Successful in 13s
Release / Gitea Release (push) Successful in 27s
Previously: 'docker compose up -d' recreated all services with changed images,
causing dependent services (pocketbase, minio, redis, etc.) to restart and
wait for healthchecks, leading to longer downtime.

Now: Use '--no-deps' flag to restart ONLY the services with updated images
(backend, runner, ui, caddy, pocketbase) without touching their dependencies.

Benefits:
- Faster deployments (~15-20s vs ~60s)
- No unnecessary restarts of infrastructure services
- Reduced downtime for the application

The final 'docker compose up -d --remove-orphans' ensures any orphaned
containers are cleaned up and all services are in the desired state.
2026-04-16 21:51:42 +05:00
Admin
7a4008bd9c chore: improve workflow job names for clarity
All checks were successful
Release / Test backend (push) Successful in 1m2s
Release / Test UI (push) Successful in 58s
Release / Build and push images (push) Successful in 4m34s
Release / Deploy to prod (push) Successful in 2m24s
Release / Deploy to homelab (push) Successful in 15s
Release / Gitea Release (push) Successful in 20s
- 'Check ui' → 'Test UI' (consistent with 'Test backend')
- 'Docker' → 'Build and push images' (more descriptive of what it does)

Job IDs remain unchanged (test-backend, check-ui, docker) for stability.
2026-04-16 21:34:23 +05:00

View File

@@ -32,7 +32,7 @@ jobs:
# ── ui: type-check & build ────────────────────────────────────────────────────
check-ui:
name: Check ui
name: Test UI
runs-on: ubuntu-latest
defaults:
run:
@@ -57,7 +57,7 @@ jobs:
# ── docker: build + push all images via docker bake ──────────────────────────
docker:
name: Docker
name: Build and push images
runs-on: ubuntu-latest
needs: [test-backend, check-ui]
steps:
@@ -130,6 +130,8 @@ jobs:
'set -euo pipefail
cd /opt/libnovel
doppler run -- docker compose pull backend runner ui caddy pocketbase
# Restart only the services with new images, without waiting for dependencies
doppler run -- docker compose up -d --no-deps backend runner ui caddy pocketbase
doppler run -- docker compose up -d --remove-orphans'
# ── deploy homelab runner ─────────────────────────────────────────────────────