-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (55 loc) · 1.54 KB
/
docs_pages.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Documentation
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Check out repository
uses: actions/checkout@master
with:
fetch-depth: 0
# install & configure poetry
- name: Install Poetry
uses: snok/install-poetry@v1 # v1.2.0
with:
version: 1.2.0b1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# load cached venv if cache exists
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-docs-3-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
# install dependencies if cache does not exist
- name: Install dependencies if no cache
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --only docs
# install metaDMG
- name: Install metaDMG
run: poetry install --with docs
- name: Build documentation
run: |
mkdir gh-pages
touch gh-pages/.nojekyll
cd docs/
poetry run make clean && poetry run make html
cp -r build/html/* ../gh-pages/
- name: Deploy documentation
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages