deploy.yml: sync compose+Caddyfile from git, reload caddy after up
This commit is contained in:
parent
1f9dde2bf3
commit
b7230f1bc8
1 changed files with 12 additions and 0 deletions
12
.github/workflows/deploy.yml
vendored
12
.github/workflows/deploy.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue