croft 0.1.1

Per-project dev-loop tool: Docker Compose, scripts, hooks, and agents in one config
Documentation
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: [main]
    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"}'