Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/docs-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Docs: Build and deploy MkDocs site

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction

- name: Build MkDocs site
run: poetry run mkdocs build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload built site artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

26 changes: 26 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
site_name: Redis OM Python
site_description: Object mapping, and more, for Redis and Python.
site_url: https://redis.github.io/redis-om-python/
repo_url: https://github.com/redis/redis-om-python
repo_name: redis-om-python

# Source Markdown lives in the existing docs/ directory.
docs_dir: docs

# Use the built-in MkDocs theme for now. This avoids extra dependencies.
theme:
name: mkdocs

nav:
- Home: index.md
- Getting started: getting_started.md
- Models: models.md
- Connections: connections.md
- Validation: validation.md
- Redis modules: redis_modules.md
- Migrations:
- Overview: migrations.md
- Upgrade 0.x to 1.x: migration_guide_0x_to_1x.md
- FastAPI integration: fastapi_integration.md
- Errors: errors.md

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ tox = "^4.14.1"
tox-pyenv = "^1.1.0"
codespell = "^2.2.0"
pre-commit = {version = "^4.3.0", python = ">=3.9"}
mkdocs = "^1.6.1"

[tool.poetry.scripts]
# Unified CLI (new, recommended) - uses async components
Expand Down
Loading