la-li-lu-le-lo/deploy.sh
rain 346d08ad6a Correct the deploy timing: Pages is cached, not instant
Observed the public URL serving the previous build for ~3.5 minutes after a
push. Responses carry x-pages-cache: true and cache-control: max-age=600, and
a cache-busting query does not bypass it. The earlier claim of ~15s was wrong.

AGENTS.md and deploy.sh now say to check the repo raw file FIRST: if that
matches the local build the push landed and only the cache is behind, so don't
start changing things.
2026-09-15 17:45:37 -04:00

37 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Rebuild the companion and publish it to the Pages branch.
#
# ./deploy.sh commit as "Update companion"
# ./deploy.sh "fix dog tags" custom commit message
#
# The Pages site rebuilds itself from the pushed branch, usually within ~15s:
# https://rain.pages.melonbread.xyz/la-li-lu-le-lo/
#
set -euo pipefail
cd "$(dirname "$0")"
echo "==> building"
python3 build/build.py
if git diff --quiet && git diff --cached --quiet; then
echo "==> nothing changed, nothing to publish"
exit 0
fi
echo "==> committing"
git add -A
git commit -m "${1:-Update companion}"
echo "==> pushing"
git push origin pages
echo
echo "pushed to pages."
echo
echo "Pages is cached (max-age=600), so the public URL can lag by a few minutes."
echo "Check the repo first - if this matches, the push landed and only the cache is behind:"
echo " curl -s https://git.melonbread.xyz/rain/la-li-lu-le-lo/raw/branch/pages/index.html | sha256sum"
echo " sha256sum index.html"
echo "Then the live copy:"
echo " curl -sL https://rain.pages.melonbread.xyz/la-li-lu-le-lo/ | sha256sum"