mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-04-16 14:46:24 +02:00
docs: add documentation versioning
This commit is contained in:
28
.github/workflows/docs.yml
vendored
28
.github/workflows/docs.yml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
@@ -16,9 +16,14 @@ jobs:
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/configure-pages@v5
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
@@ -26,9 +31,22 @@ jobs:
|
||||
- name: Set up Python
|
||||
run: uv python install 3.13
|
||||
|
||||
- run: uv sync --group dev
|
||||
- run: uv sync --group docs
|
||||
|
||||
- run: uv run zensical build --clean
|
||||
- name: Install mkdocs shim
|
||||
run: cp scripts/mkdocs .venv/bin/mkdocs && chmod +x .venv/bin/mkdocs
|
||||
|
||||
- name: Deploy docs version
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
MINOR_VERSION="${VERSION%.*}"
|
||||
uv run mike deploy --push --update-aliases "$MINOR_VERSION" latest
|
||||
uv run mike set-default --push latest
|
||||
|
||||
- name: Prepare site artifact
|
||||
run: git worktree add site gh-pages
|
||||
|
||||
- uses: actions/configure-pages@v5
|
||||
|
||||
- uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user