From f4b1cea1642fdf7918b0e8900b25147513db0839 Mon Sep 17 00:00:00 2001 From: DavidG Date: Sat, 14 Nov 2026 11:06:52 +0000 Subject: [PATCH] ci(docs): dispatch docs rebuild to lockfamily, nav.toml rule (#200) Send a repository_dispatch (type docs) to lockfamily on a push to main touching README/CHANGELOG/GUIDE/docs, and on a published release, so lockfamily.dev/docs shows the change within minutes. Without the LOCKFAMILY_DOCS_TOKEN secret the job passes with a notice. README's contributing section states the nav.toml rule. Closes #200 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/docs-dispatch.yml | 36 +++++++++++++++++++++++++++++ README.md | 6 +++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/docs-dispatch.yml diff --git a/.github/workflows/docs-dispatch.yml b/.github/workflows/docs-dispatch.yml new file mode 100644 index 0000000..4f7e765 --- /dev/null +++ b/.github/workflows/docs-dispatch.yml @@ -0,0 +1,36 @@ +name: docs-dispatch + +# lockfamily.dev/docs is built by lockfamily's docs-site/build.py from this +# repository's README.md, CHANGELOG.md, GUIDE.md and docs/**. Its pages +# workflow rebuilds nightly; this dispatch makes a change to those files, or +# a release, show on the site within minutes. +# +# LOCKFAMILY_DOCS_TOKEN: a fine-grained token limited to +# DavidGodefroid/lockfamily, Contents read and write (lockfamily#39). Without +# it the job passes with a notice and the nightly build picks the change up. + +on: + push: + branches: [main] + paths: + - README.md + - CHANGELOG.md + - GUIDE.md + - "docs/**" + release: + types: [published] + +permissions: {} + +jobs: + dispatch: + name: dispatch docs to lockfamily + runs-on: ubuntu-latest + permissions: {} + steps: + - name: send repository_dispatch (docs) + env: + GH_TOKEN: ${{ secrets.LOCKFAMILY_DOCS_TOKEN }} + run: | + if [ -z "$GH_TOKEN" ]; then echo "::notice::LOCKFAMILY_DOCS_TOKEN not set"; exit 0; fi + gh api repos/DavidGodefroid/lockfamily/dispatches -f event_type=docs diff --git a/README.md b/README.md index a9a852f..5a1f562 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,12 @@ one hub approves for all of them. Start at [lockfamily.dev](https://lockfamily.d product or work around it: ask for the change, as [GUIDE.md ยง 15](GUIDE.md#15-asking-for-a-lockkit-change) describes. Tests: `go vet ./... && go test ./...`. +- **Docs:** docs are published at + [lockfamily.dev/docs](https://lockfamily.dev/docs/) from this repo's + Markdown. Adding a file under `docs/`, or renaming or removing a README H2 + section, needs a matching change to + [lockfamily's `docs-site/nav.toml`](https://github.com/DavidGodefroid/lockfamily/blob/main/docs-site/nav.toml): + open a lockfamily PR, or the nightly docs build fails. - **Security:** report vulnerabilities privately through [GitHub security advisories](https://github.com/DavidGodefroid/lockkit/security/advisories/new). - **License:** Apache License 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).