Add Phase 5 Caddy deployment config and sync script

- deploy/baflakehouse.caddy: handle_path snippet routes /baflakehouse*
  to docs/ with prefix stripping so pkgdown flat structure maps correctly
- bin/sync-caddy.sh: one-time script to install snippet and zero-downtime
  reload Caddy; deploy.R handles everything after that automatically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 04:56:10 -05:00
parent 7a1a8e0053
commit 5218deab74
2 changed files with 35 additions and 0 deletions

22
bin/sync-caddy.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# bin/sync-caddy.sh
#
# One-time (or on Caddy config change) script to install the baflakehouse
# Caddy route snippet and reload Caddy with zero downtime.
#
# Run from the project root:
# bash bin/sync-caddy.sh
set -euo pipefail
SNIPPET_SRC="$(dirname "$0")/../deploy/baflakehouse.caddy"
SNIPPET_DST="/docker/caddy/conf.d/baflakehouse.caddy"
CADDY_CONTAINER="caddy"
echo "→ Copying Caddy snippet to ${SNIPPET_DST}..."
cp "${SNIPPET_SRC}" "${SNIPPET_DST}"
echo "→ Reloading Caddy (zero downtime)..."
docker exec "${CADDY_CONTAINER}" caddy reload -c /etc/caddy/Caddyfile
echo "✔ Done. Site live at https://docs.robwiederstein.org/baflakehouse"

13
deploy/baflakehouse.caddy Normal file
View File

@@ -0,0 +1,13 @@
# BAF Lakehouse pkgdown site
# Served at: https://docs.robwiederstein.org/baflakehouse
#
# handle_path strips the /baflakehouse prefix before handing off to the
# file server, so requests map correctly to the flat docs/ directory.
#
# NOTE: The path below must match the mount point inside the Caddy Docker
# container (i.e., wherever /data/projects/ is mounted in docker-compose.yml).
handle_path /baflakehouse* {
root * /data/projects/bank-fraud-baf-lakehouse/docs
file_server
}