- publish-wiki-pages.yml: reusable workflow with wiki_dir, prune and tools-ref inputs and the declared secret TOKEN_FOR_GITEA_WIKI - tools/publish_wiki.py: WIKI_PRUNE selects explicit mode without the marker; a missing folder is a configuration error - publish-own-wiki.yml: this repository calls the reusable workflow - wiki/ moves to docs/wiki/; build_wiki.py and its tests follow - the scoped publish-wiki.yml is marked deprecated, not removed - guides, README and the Danish and Bahasa Malaysia wiki pages describe the caller, docs/wiki/ and the new error messages Task: MIL-008#2 Task: MIL-008#4 Task: MIL-008#5 Task: MIL-008#6
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
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
|