#!/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"