72 lines
2.0 KiB
YAML
72 lines
2.0 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"
|
|
- "scripts/verify-auth-docs.py"
|
|
- "scripts/test-verify-auth-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: Test current authentication documentation
|
|
run: |
|
|
python scripts/verify-auth-docs.py auth
|
|
python scripts/verify-auth-docs.py dwh
|
|
python scripts/test-verify-auth-docs.py auth
|
|
python scripts/test-verify-auth-docs.py dwh
|
|
|
|
- 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
|