eleven / ocho Public

docs: add a local fallback for the guide-to-website sync (#891)

The Actions-based sync (#886) needs WEBSITE_REPO_TOKEN and a working billing
account on the org — neither always true. tools/sync-guide-to-website.sh
does the same copy/commit/push by hand against a local checkout of
elevenmessenger/website, using the operator's own git credentials instead of
a token. Documented alongside the token setup in
docs/planet-scale-guide/README.html.
Co-authored-by: Claude <noreply@anthropic.com>
James Adam 6f164c0a247ca2522be468b5e93b383430b91f34 parent 9548c6a
2 files changed, +45 −0
  • docs/planet-scale-guide/README.html +1 −0
  • tools/sync-guide-to-website.sh +44 −0
diff --git a/docs/planet-scale-guide/README.html b/docs/planet-scale-guide/README.html
index 2b539d5..2b4a113 100644
--- a/docs/planet-scale-guide/README.html
+++ b/docs/planet-scale-guide/README.html
@@ -79,6 +79,7 @@ open docs/planet-scale-guide/index.html # macOS; or any static file s
</ol>
<p>Until the secret is set, the workflow runs, logs a warning, and does nothing else — it never fails loudly and never risks a partial or broken sync.</p>
</div>
+<p><code>tools/sync-guide-to-website.sh &lt;path-to-a-local-checkout-of-website&gt;</code> does the same copy-commit-push by hand, using your own git credentials instead of the token — useful when Actions can&rsquo;t run (a billing/spending-limit block, say) or to try a guide change before merging it.</p>
</div>
</main>
diff --git a/tools/sync-guide-to-website.sh b/tools/sync-guide-to-website.sh
new file mode 100755
index 0000000..0e1e4f6
--- /dev/null
+++ b/tools/sync-guide-to-website.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env sh
+# Manual/local fallback for .github/workflows/sync-guide-to-website.yml —
+# 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 GitHub Actions workflow does this automatically on every push to main;
+# use this script when Actions can't run (e.g. a billing/spending-limit
+# block) or to test the sync before merging a guide change. Unlike the
+# workflow, this needs no WEBSITE_REPO_TOKEN — it uses your own local git
+# credentials, exactly like pushing any other change by hand.
+#
+# ./tools/sync-guide-to-website.sh <path-to-a-local-checkout-of-website>
+#
+# # 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 <path-to-a-local-checkout-of-elevenmessenger/website>}"
+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 — elevenmessenger/website's own deploy workflow will publish it shortly."