Skip to content

Commit cf0343d

Browse files
authored
Modernize docs publishing workflow (#54)
1 parent c60689c commit cf0343d

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

.github/workflows/publish-docs.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,33 @@ jobs:
1111

1212
steps:
1313
- name: Checkout Repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Setup Python
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
19-
python-version: 3.9
19+
python-version: "3.11"
2020

2121
- name: Install Poetry
22-
run: |
23-
curl -sSL https://install.python-poetry.org | python -
24-
export PATH="$HOME/.poetry/bin:$PATH"
25-
poetry --version
26-
27-
- name: Install Dependencies and Build Documentation
28-
run: |
29-
poetry install -E docs
30-
cd docs
31-
poetry run make html
32-
env:
33-
POETRY_VIRTUALENVS_IN_PROJECT: true
22+
uses: snok/install-poetry@v1
23+
with:
24+
virtualenvs-create: true
25+
virtualenvs-in-project: true
26+
installer-parallel: true
27+
28+
- name: Load cached venv
29+
id: cached-poetry-dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: .venv
33+
key: docs-venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
34+
35+
- name: Install Dependencies
36+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
37+
run: poetry install -E docs --no-interaction --no-root
38+
39+
- name: Build Documentation
40+
run: poetry run sphinx-build -b html docs docs/_build/html
3441

3542
- name: Deploy documentation.
3643
if: ${{ github.event_name == 'push' }}

0 commit comments

Comments
 (0)