Skip to content

Build and deploy the documentation #11

Build and deploy the documentation

Build and deploy the documentation #11

---
name: Build and deploy the documentation
on:
push:
branches:
- master
- dev
paths:
- "**.py"
- ".github/workflows/docs-build-and-deploy.yaml"
- "docs/**"
tags:
- v*
pull_request:
branches:
- master
workflow_dispatch:
env:
PAGES_UPLOAD: ${{ vars.PAGES_UPLOAD }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
permissions:
pages: write
id-token: write
contents: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: 1.3.2
- name: Install dependencies
run: poetry install --no-interaction --without dev
- name: Install rsync
run: sudo apt-get update && sudo apt-get install -y rsync
- name: Build documentation
run: |
cd docs
TZ=UTC poetry run make docs
touch build/html/.nojekyll
- name: Deploy documentation
if: ${{ env.PAGES_UPLOAD == 'true' && success() }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html
branch: gh-pages