Files
semantica/.github/workflows/docs.yml
T

56 lines
1.4 KiB
YAML

name: Documentation
on:
push:
branches: [ main ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- 'mkdocs.yml'
workflow_dispatch:
# Manual trigger for deploying documentation
jobs:
build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-docs.txt
pip install mkdocs-material mkdocstrings[python]
- name: Build documentation
run: mkdocs build --strict
- name: Check for broken links
run: |
pip install linkchecker || echo "linkchecker installation failed, skipping link check"
if [ -d "site" ]; then
linkchecker site/ --check-extern || echo "Link check completed with warnings"
fi
continue-on-error: true
# Documentation deployment is manual for safety
# To deploy: Go to Actions tab -> Documentation workflow -> Run workflow
- name: Deploy to GitHub Pages (Manual)
if: github.event_name == 'workflow_dispatch'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
keep_files: false