Skip to content

Docs

Docs #609

Workflow file for this run

name: Docs
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
pull_request:
branches:
- main
workflow_dispatch:
env:
POETRY_VERSION: "1.8.2"
jobs:
docs:
name: Build and Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Load cached Poetry installation
id: cache-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ env.POETRY_VERSION }}-${{ runner.os }}
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Load cached venv
id: cache-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-py3.11-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Build docs
id: build-docs
if: github.event_name != 'push' || github.ref_name != github.event.repository.default_branch
env:
API_KEY: ${{ secrets.API_KEY_2 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run mkdocs build
- name: Upload docs
uses: actions/upload-artifact@v4
if: steps.build-docs.outcome == 'success'
with:
name: docs
path: ./site
if-no-files-found: error
- name: Deploy docs
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
env:
API_KEY: ${{ secrets.API_KEY_2 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_EVALDOCS: true
run: poetry run mkdocs gh-deploy --force