richardnixon.dev-hugo/deploy.sh

14 lines
513 B
Bash
Executable file

#!/usr/bin/env bash
# build + sync hugo output to /root/richardnixon.dev-hugo/public (mounted into blog-static container).
# blog-static serves directly from the bind-mount, so no docker restart needed.
set -euo pipefail
cd "$(dirname "$0")"
hugo --minify --gc
echo "build OK"
# Optional: warm the container by hitting it via traefik network.
if docker ps --format '{{.Names}}' | grep -q '^blog-static$'; then
docker exec traefik wget -q --spider http://blog-static/pt-br/ && echo "blog-static reachable"
fi