Skip to content

test-python

test-python #12

Workflow file for this run

name: Build Python documentation
on:
pull_request:
paths:
- docs/**
- .github/workflows/docs-python.yml
push:
branches:
- main
paths:
- docs/**
- .github/workflows/docs-python.yml
repository_dispatch:
types: [test-python]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-python-docs:
strategy:
fail-fast: true
matrix:
python-version: ['3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create virtual environment
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv -p ${{ matrix.python-version }}
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Install Python dependencies
working-directory: docs
run: uv pip install -r docs/requirements.txt
# Cache HDF5
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Cache apt packages
with:
packages: libhdf5-dev
version: 1.0
- name: Install up4
run: uv pip install .
- name: Build Python documentation
working-directory: docs
run: make html
- name: Deploy Python docs for latest development version
if: github.event_name == 'push' && github.ref_name == 'uPPPP'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/build/html