Skip to content

Commit 9974f0b

Browse files
committed
setup docs publish
1 parent 01b617a commit 9974f0b

3 files changed

Lines changed: 55 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,44 @@ jobs:
3131

3232
- name: Publish
3333
run: uv publish
34+
35+
# Build the documentation and upload the static HTML files as an artifact.
36+
build-docs:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v6
41+
42+
- name: Setup Python
43+
uses: actions/setup-python@v6
44+
with:
45+
python-version-file: "pyproject.toml"
46+
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v7
49+
50+
- name: Setup project
51+
run: uv sync --all-extras --dev
52+
53+
- name: Build docs
54+
run: uv run pdoc lpdb_python.defs lpdb_python.session lpdb_python.async_session -t docs/ -o output/docs/
55+
env:
56+
VERSION: ${{ github.ref_name }}
57+
58+
- uses: actions/upload-pages-artifact@v4
59+
with:
60+
path: output/docs/
61+
62+
deploy:
63+
needs: build-docs
64+
runs-on: ubuntu-latest
65+
permissions:
66+
pages: write
67+
id-token: write
68+
environment:
69+
name: github-pages
70+
url: ${{ steps.deployment.outputs.page_url }}
71+
steps:
72+
- name: Deploy
73+
id: deployment
74+
uses: actions/deploy-pages@v4

docs/module.html.jinja2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "default/module.html.jinja2" %}
2+
3+
{% block nav_footer %}
4+
<footer>
5+
lpdb_python {{ env["VERSION"] | default("0.0.0") }}
6+
<br />
7+
<a href="https://github.com/ElectricalBoy/LPDB_python"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/ElectricalBoy/lpdb_python" /></a>
8+
</footer>
9+
{% endblock %}

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ async = [
3232
[dependency-groups]
3333
dev = [
3434
{include-group = "test"},
35-
{include-group = "lint"}
35+
{include-group = "lint"},
36+
{include-group = "docs"}
3637
]
3738
test = [
3839
"pytest",
@@ -41,6 +42,9 @@ test = [
4142
lint = [
4243
"black",
4344
]
45+
docs = [
46+
"pdoc",
47+
]
4448

4549
[tool.pytest.ini_options]
4650
pythonpath = [

0 commit comments

Comments
 (0)