Skip to content

Merge pull request #64 from smith6jt-cop/claude/gifted-ptolemy-3GIL6 #151

Merge pull request #64 from smith6jt-cop/claude/gifted-ptolemy-3GIL6

Merge pull request #64 from smith6jt-cop/claude/gifted-ptolemy-3GIL6 #151

Workflow file for this run

name: Deploy Documentation
on:
push:
branches: [main, master]
paths:
- 'docs/**'
- 'src/kintsugi/**'
- '.github/workflows/docs.yml'
pull_request:
branches: [main, master]
paths:
- 'docs/**'
workflow_dispatch: # Allow manual trigger
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'docs/requirements.txt'
- name: Install documentation dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
# Install the package itself so autodoc can import all modules
pip install -e . || echo "Package install failed, continuing with mocked imports"
- name: Clean Sphinx environment
run: |
# Remove cached Sphinx files to avoid WindowsPath/PosixPath issues
# when builds happen across different platforms
cd docs
rm -rf .doctrees .env .pytest_cache _build .cache
cd ..
- name: Build documentation (strict - pushes)
if: github.event_name != 'pull_request'
run: |
cd docs
sphinx-build -M html . _build -W --keep-going
- name: Build documentation (non-strict - pull requests)
if: github.event_name == 'pull_request'
run: |
cd docs
sphinx-build -M html . _build --keep-going
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html
# Deploy job only runs on main/master branch pushes, not PRs
deploy:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4