1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Docs
# Two triggers, one workflow:
# - push to docs/** on main: sync docs/ to the wiki, then notify croft-web.
# - gollum (wiki UI edit): skip the sync (docs/ stays the source of truth)
# and only notify croft-web.
#
# Consolidated because the previous split (wiki-sync + notify-on-gollum) never
# dispatched on docs/** pushes: the wiki-sync push uses GITHUB_TOKEN, and GitHub
# does not fire gollum from GITHUB_TOKEN-driven events.
on:
push:
branches:
paths:
- 'docs/**'
gollum:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
if: github.event_name == 'push'
uses: actions/checkout@v6
- name: Sync to wiki
if: github.event_name == 'push'
uses: Andrew-Chen-Wang/github-wiki-action@v4
with:
path: docs/
token: ${{ secrets.GITHUB_TOKEN }}
# Rewrites .md cross-links to bare wiki links so authoring
# works in editor previews, in the repo browser, and on the
# wiki — same source, three contexts.
preprocess: true
- name: Trigger croft-web deploy
run: |
curl -sSf -X POST \
-H "Authorization: Bearer ${{ secrets.CROFT_WEB_DISPATCH_PAT }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/nsrosenqvist/croft-web/dispatches \
-d '{"event_type":"wiki-updated"}'