Add deploy/publish.sh redeploy helper + document production split

One command to rebuild the frontend, sync it to the live Caddy site, refresh the
API container, and reload Caddy. README documents the upbeatbytes.com topology.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-01 02:20:29 +00:00
parent 92fafa8785
commit 86975d599b
2 changed files with 35 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Publish Upbeat Bytes: build the frontend, sync it to the live Caddy site,
# rebuild/restart the API container, and reload Caddy. One command to redeploy.
set -euo pipefail
repo="$(cd "$(dirname "$0")/.." && pwd)"
site="/home/jay/srv/sites/upbeatbytes"
api_compose="/home/jay/srv/upbeatbytes/compose.yaml"
echo "→ building frontend"
( cd "$repo/frontend" && npm run build )
echo "→ syncing static site to $site"
rsync -a --delete "$repo/frontend/build/" "$site/"
echo "→ rebuilding/refreshing API container"
docker compose -f "$api_compose" up -d --build
echo "→ reloading Caddy"
docker exec caddy caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
echo "✓ Published Upbeat Bytes → https://upbeatbytes.com"