#!/usr/bin/env sh # Step 1 of publishing the guide to elevenmessenger.com — mirrors # docs/planet-scale-guide/ into elevenmessenger/website's src/infrastructure/ # (Eleventy passthrough-copies it to /infrastructure/ unmodified — see that # repo's .eleventy.js), commits, and pushes the website's main. # # The old GitHub Actions auto-sync (.github/workflows/sync-guide-to-website.yml) # is DISABLED — the project builds the site locally now — so this is the normal # path, not a fallback. After it pushes, run ./deploy.sh in the website checkout # to build and publish (step 2). It needs no token: it uses your own local git # credentials, exactly like pushing any other change by hand. # # ./tools/sync-guide-to-website.sh # # # first time: clone it somewhere, then point this script at it # gh repo clone elevenmessenger/website /tmp/website # ./tools/sync-guide-to-website.sh /tmp/website set -eu WEBSITE_DIR="${1:?usage: $0 }" REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" if [ ! -d "$WEBSITE_DIR/.git" ]; then echo "sync-guide-to-website: $WEBSITE_DIR is not a git checkout — clone elevenmessenger/website there first" >&2 exit 1 fi echo "Updating $WEBSITE_DIR (git pull)..." git -C "$WEBSITE_DIR" pull --ff-only echo "Copying $REPO_ROOT/docs/planet-scale-guide/ -> $WEBSITE_DIR/src/infrastructure/..." rm -rf "$WEBSITE_DIR/src/infrastructure" mkdir -p "$WEBSITE_DIR/src/infrastructure" cp -r "$REPO_ROOT"/docs/planet-scale-guide/* "$WEBSITE_DIR/src/infrastructure/" cd "$WEBSITE_DIR" git add src/infrastructure if git diff --cached --quiet; then echo "No changes to the guide — nothing to sync." exit 0 fi git commit -m "docs: sync planet-scale guide from elevenmessenger/messenger@$(git -C "$REPO_ROOT" rev-parse --short HEAD)" git push echo "Pushed website main. Now run ./deploy.sh in $WEBSITE_DIR to build + publish (no Actions)."