Skip to content

Merge pull request #300 from haraldschilly/claude/loop-d5-slice #747

Merge pull request #300 from haraldschilly/claude/loop-d5-slice

Merge pull request #300 from haraldschilly/claude/loop-d5-slice #747

Workflow file for this run

name: Deploy Documentation
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Required permissions for pushing to gh-pages branch
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Cache UV and dependencies
id: cache-uv
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/uv
.venv
key: uv-${{ runner.os }}-python-${{ env.PYTHON }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-python-${{ env.PYTHON }}-
- name: Install UV
run: |
if [ ! -f "$HOME/.cargo/bin/uv" ]; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
if: steps.cache-uv.outputs.cache-hit != 'true'
run: |
uv sync --extra dev
- name: Install Sphinx
run: |
uv add --dev sphinx
- name: Build documentation
run: |
uv run sphinx-build -b html doc/source doc/build/html
echo "✅ Documentation built successfully"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: github-pages
path: doc/build/html
deploy:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v6
with:
ref: gh-pages
path: gh-pages
- name: Download built docs
uses: actions/download-artifact@v8
with:
name: github-pages
path: built-docs
- name: Deploy to gh-pages
run: |
cd gh-pages
rm -rf *
mv ../built-docs/* .
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Deploy documentation for ${GITHUB_SHA}" || echo "No changes to commit"
git push