Repository navigation
52 lines (46 loc) · 1.57 KB
/
Copy pathdocs.yml
File metadata and controls
52 lines (46 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Documentation
# Builds the Sphinx documentation (docs/rst) on every change of the docs or of the code (the API
# pages come from the docstrings), and publishes it to GitHub Pages from main:
# https://mattechlab.github.io/monalisa-python/ (Settings → Pages → Source: GitHub Actions).
# Warnings fail the build (-W), so that broken references are seen in pull requests.
on:
push:
branches: [main]
paths: ["docs/**", "src/**", "pyproject.toml", ".github/workflows/docs.yml"]
pull_request:
paths: ["docs/**", "src/**", "pyproject.toml", ".github/workflows/docs.yml"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- run: pip install -e . -r docs/requirements.txt
- run: sphinx-build -W --keep-going -b html docs/rst docs/_build/html
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
with:
path: docs/_build/html
deploy:
name: Publish to GitHub Pages
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4