-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (41 loc) · 1.19 KB
/
docs.yml
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
name: GitHub Pages
on: # Always attempt html build on push & PR, but only deploy when there is a new tag.
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch: # Allows to manually trigger the job from the web UI.
jobs:
build:
name: Build documentation (and deploy for git tag)
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
python3 -m pip install --upgrade pip
python3 -m venv .venv-gh-pages
source .venv-gh-pages/bin/activate
python3 -m pip install "$PWD"[doc,test]
make html
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html