From 3331bbc4a6f124ec14b043f083ce7b67790b6fb7 Mon Sep 17 00:00:00 2001 From: Andrew Brookins Date: Thu, 20 Nov 2025 16:11:01 -0800 Subject: [PATCH] Add GH workflow --- .github/workflows/docs-pages.yml | 72 ++++++++++++++++++++++++++++++++ mkdocs.yml | 26 ++++++++++++ pyproject.toml | 1 + 3 files changed, 99 insertions(+) create mode 100644 .github/workflows/docs-pages.yml create mode 100644 mkdocs.yml diff --git a/.github/workflows/docs-pages.yml b/.github/workflows/docs-pages.yml new file mode 100644 index 00000000..ef23559b --- /dev/null +++ b/.github/workflows/docs-pages.yml @@ -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 + diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..7a27b093 --- /dev/null +++ b/mkdocs.yml @@ -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 + diff --git a/pyproject.toml b/pyproject.toml index c85857f0..9dccb0a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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