Run wiki sync on docker runners (skip cleanly without token) (#75)
Sync course wiki / sync-wiki (push) Successful in 3s

Co-authored-by: claude <claude@jpaul.io>
Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #75.
This commit is contained in:
2026-06-22 19:02:47 -04:00
committed by Claude (agent)
parent b0efe4912d
commit e5960c17ab
+9 -12
View File
@@ -1,11 +1,9 @@
# Render the course (single source of truth = modules/) into the Gitea wiki on # Render the course (single source of truth = modules/) into the Gitea wiki on
# every push to main. The wiki is generated BUILD OUTPUT — never hand-edit it. # every push to main. The wiki is generated BUILD OUTPUT — never hand-edit it.
# #
# Prerequisites (one-time): # Runs on the stack's shared `docker` runners (Linux). To actually push the wiki it
# 1. An Actions runner is attached to this repo/org (Settings -> Actions -> Runners). # needs a repo secret WIKI_TOKEN with wiki write (a scoped PAT/deploy token — NOT a
# 2. A repo secret WIKI_TOKEN holds a token with write access to the wiki # site-admin token). Until that secret exists the job skips cleanly (stays green).
# (a PAT/deploy token scoped to repository write is enough — NOT a site-admin token).
# 3. The wiki is initialized (it is — created with a Home page).
name: Sync course wiki name: Sync course wiki
on: on:
push: push:
@@ -20,22 +18,21 @@ on:
jobs: jobs:
sync-wiki: sync-wiki:
runs-on: ubuntu-latest runs-on: docker
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Render and push the wiki - name: Render and push the wiki
shell: bash shell: bash
env: env:
WIKI_TOKEN: ${{ secrets.WIKI_TOKEN }} WIKI_TOKEN: ${{ secrets.WIKI_TOKEN }}
run: | run: |
set -euo pipefail set -euo pipefail
echo "runner: $(uname -srm) — $(python3 --version 2>/dev/null || echo 'python3 missing')"
if [ -z "${WIKI_TOKEN:-}" ]; then if [ -z "${WIKI_TOKEN:-}" ]; then
echo "::error::WIKI_TOKEN secret is not set — see this workflow's header." echo "::warning::WIKI_TOKEN secret not set — skipping wiki sync. Add the secret to enable auto-sync."
exit 1 exit 0
fi fi
command -v python3 >/dev/null || { apt-get update && apt-get install -y --no-install-recommends python3; }
base="git.jpaul.io/justin/ai-workflow-course" base="git.jpaul.io/justin/ai-workflow-course"
git clone "https://claude:${WIKI_TOKEN}@${base}.wiki.git" wiki git clone "https://claude:${WIKI_TOKEN}@${base}.wiki.git" wiki
python3 tools/build_wiki.py --repo-root . --out wiki \ python3 tools/build_wiki.py --repo-root . --out wiki \