Files
ThothII/.gitea/workflows/publish-docs.yml
T
Codex 043ffdfad6
Publish documentation / publish (push) Successful in 27s
docs: separate public manual from internal project documentation
2026-09-15 10:26:35 +02:00

63 lines
1.6 KiB
YAML

name: Publish documentation
on:
push:
branches:
- main
paths:
- "docs/**"
- "mkdocs.yml"
- "scripts/build-docs.sh"
- "scripts/verify-public-docs.py"
- "scripts/test-verify-public-docs.py"
- "docs/requirements.txt"
- ".gitea/workflows/publish-docs.yml"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: documentation
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPOSITORY_URL: ${{ gitea.server_url }}/${{ gitea.repository }}.git
steps:
- name: Checkout documentation source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
cache-dependency-path: docs/requirements.lock
- name: Install MkDocs dependencies
run: python -m pip install -r docs/requirements.lock
- name: Test public documentation boundary
run: python scripts/test-verify-public-docs.py
- name: Build documentation
run: |
mkdocs build --strict
python scripts/verify-public-docs.py
- name: Publish generated site to the pages branch
working-directory: site
run: |
git init
git config user.name "Gitea Actions"
git config user.email "actions@${{ gitea.server_url }}"
git add --all
git commit --message "Publish documentation for ${{ gitea.sha }}"
git -c http.extraheader="Authorization: token ${GITEA_TOKEN}" \
push --force "${REPOSITORY_URL}" HEAD:pages