[docs] update docs hook to report actions

This commit is contained in:
Jan Petykiewicz 2026-04-19 00:14:23 -07:00
commit 5de5f7bf26

View file

@ -6,10 +6,12 @@ REMOTE_NAME="${1:-}"
REMOTE_URL="${2:-}" REMOTE_URL="${2:-}"
if [[ "${MEANAS_DOCS_PUBLISHING:-0}" == "1" ]]; then if [[ "${MEANAS_DOCS_PUBLISHING:-0}" == "1" ]]; then
echo "[meanas docs hook] recursive docs publish detected; skipping" >&2
exit 0 exit 0
fi fi
if [[ "$REMOTE_NAME" != "origin" ]]; then if [[ "$REMOTE_NAME" != "origin" ]]; then
echo "[meanas docs hook] push was to remote '${REMOTE_NAME:-<none>}' not 'origin'; skipping" >&2
exit 0 exit 0
fi fi
@ -22,6 +24,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
done done
if [[ "$publish_docs" != "1" ]]; then if [[ "$publish_docs" != "1" ]]; then
echo "[meanas docs hook] no master->master update in push; skipping docs publish" >&2
exit 0 exit 0
fi fi
@ -36,6 +39,11 @@ fi
DOCS_SITE_URL="${DOCS_SITE_URL:-$(git config --get meanas.docsSiteUrl || true)}" DOCS_SITE_URL="${DOCS_SITE_URL:-$(git config --get meanas.docsSiteUrl || true)}"
export DOCS_SITE_URL export DOCS_SITE_URL
if [[ -n "$DOCS_SITE_URL" ]]; then
echo "[meanas docs hook] publishing docs for ${DOCS_SITE_URL}" >&2
else
echo "[meanas docs hook] DOCS_SITE_URL is unset; building docs with relative site_url" >&2
fi
echo "[meanas docs hook] building docs after push to ${REMOTE_NAME} (${REMOTE_URL})" >&2 echo "[meanas docs hook] building docs after push to ${REMOTE_NAME} (${REMOTE_URL})" >&2
MEANAS_DOCS_PUBLISHING=1 ./make_docs.sh MEANAS_DOCS_PUBLISHING=1 ./make_docs.sh
echo "[meanas docs hook] publishing docs-site branch" >&2 echo "[meanas docs hook] publishing docs-site branch" >&2