diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5d16591f..d93ae8cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -72,9 +72,21 @@ jobs: script: | set -euo pipefail cd /opt/gendesign + + # Sync compose / Caddyfile / init scripts from the repo. + # --ff-only refuses if there are local commits on the VM (we don't expect any). + git fetch origin main + git reset --hard origin/main + export IMAGE_TAG="$IMAGE_TAG" docker compose -f docker-compose.prod.yml pull docker compose -f docker-compose.prod.yml up -d + + # Caddyfile is bind-mounted; up -d won't re-read it. Reload explicitly. + # `|| true` so a temporary Caddy hiccup doesn't fail the whole deploy. + docker compose -f docker-compose.prod.yml exec -T caddy \ + caddy reload --config /etc/caddy/Caddyfile || true + docker image prune -f sleep 8 curl -fsS http://localhost:8000/health | head -c 200 || true