name: Publish wiki # Reusable workflow (ADR-0009, MIL-008). A repository calls it with # # on: # push: # branches: [ main ] # paths: [ "docs/wiki/**" ] # jobs: # wiki: # uses: TirSystem/github-action/.gitea/workflows/publish-wiki-pages.yml@v1 # secrets: # TOKEN_FOR_GITEA_WIKI: ${{ secrets.TOKEN_FOR_GITEA_WIKI }} # # The caller file is the opt-in; there is no marker file. It publishes the # Markdown pages of wiki_dir to the wiki of the calling repository, creating # and updating pages, and deleting pages that are not in the folder only when # prune is true. The script is a file of this repository # (tools/publish_wiki.py), fetched at tools-ref. on: workflow_call: inputs: wiki_dir: description: "Directory, relative to the repository root, with the wiki pages" type: string default: "docs/wiki" prune: description: "true deletes wiki pages that are not in the folder; false keeps them" type: string default: "false" tools-ref: description: "Tag or branch of TirSystem/github-action whose tools/publish_wiki.py is run; pin it to the exact tag together with the workflow" type: string default: "v1" secrets: TOKEN_FOR_GITEA_WIKI: description: "Gitea token with write access to the wiki of the calling repository" required: true jobs: publish-wiki: permissions: contents: read runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Check out the repository uses: actions/checkout@v4.2.2 - name: Fetch the shared script uses: actions/checkout@v4.2.2 with: repository: TirSystem/github-action ref: ${{ inputs.tools-ref }} path: shared-scripts - name: Publish the pages to the wiki env: GITEA_API_URL: ${{ gitea.api_url }} SOURCE_REPOSITORY: ${{ gitea.repository }} WIKI_CREDENTIALS: ${{ secrets.TOKEN_FOR_GITEA_WIKI }} WIKI_DIR: ${{ inputs.wiki_dir }} WIKI_PRUNE: ${{ inputs.prune }} run: python3 shared-scripts/tools/publish_wiki.py