name: Wiki # docs/wiki/ is the source of the Gitea wiki (ADR 0009): every push to main that touches it publishes it with # scripts/publish-wiki.sh, which makes Khaemhat.wiki.git an exact copy. The secret WIKI_TOKEN (an access token with # repository write) overrides the workflow's own token if that one cannot push to the wiki. on: push: branches: [main] paths: ["docs/wiki/**"] workflow_dispatch: concurrency: group: wiki cancel-in-progress: false jobs: publish: name: Publish the wiki runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Checkout env: TOKEN: ${{ github.token }} run: | git config --global --add safe.directory "$PWD" git init -q . git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" git checkout -q FETCH_HEAD - name: Publish docs/wiki env: GITEA_TOKEN: ${{ secrets.WIKI_TOKEN || github.token }} WIKI_REMOTE: ${{ github.server_url }}/${{ github.repository }}.wiki.git GIT_AUTHOR_NAME: Khaemhat CI GIT_AUTHOR_EMAIL: ci@khaemhat.invalid run: bash scripts/publish-wiki.sh