Skip to content

Commit 3331bbc

Browse files
committed
Add GH workflow
1 parent 78b73b2 commit 3331bbc

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

.github/workflows/docs-pages.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Docs: Build and deploy MkDocs site
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v6
27+
with:
28+
python-version: "3.11"
29+
30+
- name: Install Poetry
31+
uses: snok/install-poetry@v1
32+
with:
33+
virtualenvs-create: true
34+
virtualenvs-in-project: true
35+
installer-parallel: true
36+
37+
- name: Load cached venv
38+
id: cached-poetry-dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: .venv
42+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
43+
44+
- name: Install dependencies
45+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
46+
run: poetry install --no-interaction --no-root
47+
48+
- name: Install library
49+
run: poetry install --no-interaction
50+
51+
- name: Build MkDocs site
52+
run: poetry run mkdocs build
53+
54+
- name: Setup Pages
55+
uses: actions/configure-pages@v5
56+
57+
- name: Upload built site artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: site
61+
62+
deploy:
63+
runs-on: ubuntu-latest
64+
needs: build
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4
72+

mkdocs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
site_name: Redis OM Python
2+
site_description: Object mapping, and more, for Redis and Python.
3+
site_url: https://redis.github.io/redis-om-python/
4+
repo_url: https://github.com/redis/redis-om-python
5+
repo_name: redis-om-python
6+
7+
# Source Markdown lives in the existing docs/ directory.
8+
docs_dir: docs
9+
10+
# Use the built-in MkDocs theme for now. This avoids extra dependencies.
11+
theme:
12+
name: mkdocs
13+
14+
nav:
15+
- Home: index.md
16+
- Getting started: getting_started.md
17+
- Models: models.md
18+
- Connections: connections.md
19+
- Validation: validation.md
20+
- Redis modules: redis_modules.md
21+
- Migrations:
22+
- Overview: migrations.md
23+
- Upgrade 0.x to 1.x: migration_guide_0x_to_1x.md
24+
- FastAPI integration: fastapi_integration.md
25+
- Errors: errors.md
26+

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ tox = "^4.14.1"
6666
tox-pyenv = "^1.1.0"
6767
codespell = "^2.2.0"
6868
pre-commit = {version = "^4.3.0", python = ">=3.9"}
69+
mkdocs = "^1.6.1"
6970

7071
[tool.poetry.scripts]
7172
# Unified CLI (new, recommended) - uses async components

0 commit comments

Comments
 (0)