-
Notifications
You must be signed in to change notification settings - Fork 70
38 lines (32 loc) · 1.11 KB
/
build_docs.yaml
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
# A work-flow for generating documentation given a PR
# Builds Sphinx documentation, uploads the generated HTML files as artefacts and deploys them to GitHub Pages
name: Build docs
# It runs on every pull request, but it only generates the documentation from master (which makes sense)
on:
pull_request:
branches:
- master
jobs:
sphinx-build:
# Target platform; mostly doesn't matter for HTML websites generated from Sphinx
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 1) Build HTML from Sphinx
- name: Build HTML
uses: ammaraskar/[email protected]
with:
pre-build-command: "apt install -y pandoc"
# 2) Upload the generated HTML
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: html-docs
path: docs/build/html/
# 3) Deploy using GitHub pages, but only if the branch == master
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html