Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 048867c

Browse files
Use poetry in mkdocs workflow (#27)
* Use poetry * Add poetry run * Useless change * Fix workflow
1 parent 1dee7c8 commit 048867c

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

.github/workflows/documentation.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,36 @@ jobs:
1414
run: |
1515
git config user.name github-actions[bot]
1616
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17-
- uses: actions/setup-python@v5
17+
18+
- name: Set up Python 3.12
19+
uses: actions/setup-python@v5
1820
with:
1921
python-version: 3.12
20-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
21-
- uses: actions/cache@v4
22+
23+
- name: Install poetry
24+
shell: bash
25+
run: |
26+
python -m pip install poetry
27+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
28+
29+
- name: Configure poetry
30+
shell: bash
31+
run: poetry config virtualenvs.in-project true
32+
33+
- name: Set up cache
34+
uses: actions/cache@v3
35+
id: cache
2236
with:
23-
key: mkdocs-material-${{ env.cache_id }}
24-
path: .cache
25-
restore-keys: |
26-
mkdocs-material-
27-
- run: pip install mkdocs-material mkdocstrings[python]
28-
- run: mkdocs gh-deploy --force
37+
path: .venv
38+
key: venv-documentation-${{ hashFiles('**/poetry.lock') }}
39+
40+
- name: Ensure cache is healthy
41+
if: steps.cache.outputs.cache-hit == 'true'
42+
shell: bash
43+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
44+
45+
- name: Install dependencies
46+
shell: bash
47+
run: poetry install
48+
49+
- run: poetry run mkdocs gh-deploy --force

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ betterproto is a protobuf compiler and interpreter. It improves the experience o
77
Protobuf and gRPC in Python, by generating readable, understandable, and idiomatic
88
Python code, using modern language features.
99

10+
1011
## Features
1112

1213
- Generated messages are both binary & JSON serializable

0 commit comments

Comments
 (0)