Files
simian/scripts/sync_wiki.sh
nick 33226dfae1
CI / build-and-test (push) Has been cancelled
feat: Wiki pages and sync
2026-03-08 14:48:55 +13:00

28 lines
596 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Script to sync local docs/ to the Gitea wiki for this repo.
# Requires SSH access to the wiki (deploy key or account key).
WIKI_REPO="git@gitea.appstack.me:nick/simian.wiki.git"
TMPDIR="$(mktemp -d)"
echo "Cloning wiki to $TMPDIR"
git clone "$WIKI_REPO" "$TMPDIR"
echo "Syncing docs/ -> wiki/"
rsync -av --delete docs/ "$TMPDIR"/
pushd "$TMPDIR" > /dev/null
git add -A
if git diff --staged --quiet; then
echo "No changes to wiki"
else
git commit -m "Update wiki from docs"
git push origin HEAD
fi
popd > /dev/null
rm -rf "$TMPDIR"
echo "Done."