deploy.yml: sync compose+Caddyfile from git, reload caddy after up

This commit is contained in:
lekss361 2026-04-26 14:26:57 +03:00
parent 1f9dde2bf3
commit b7230f1bc8

View file

@ -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