Skip to content

Add documentation job to build and deploy GitHub Pages #7

Add documentation job to build and deploy GitHub Pages

Add documentation job to build and deploy GitHub Pages #7

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
build:
name: Build with Pip
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set min macOS version
if: runner.os == 'macOS'
run: |
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Build and install
run: python -m pip install pytest
pip install --verbose .
- name: Python testing suite
run: python -m pytest
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
python-version: '3.10'
- name: Install dependencies
run: pip install -e .[docs]
- name: Build
run: make -C docs html
- name: Deploy to github pages
# only run on push to main
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: docs/build/html
clean: true
single-commit: true