| 1 |
name: Publish Documentation |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
- docs-update |
| 8 |
tags: |
| 9 |
- '**' |
| 10 |
|
| 11 |
permissions: |
| 12 |
contents: write |
| 13 |
|
| 14 |
jobs: |
| 15 |
publish: |
| 16 |
runs-on: ubuntu-latest |
| 17 |
timeout-minutes: 30 |
| 18 |
|
| 19 |
steps: |
| 20 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # zizmor: ignore[artipacked] |
| 21 |
with: |
| 22 |
# Necessary to fetch the docs-site branch: |
| 23 |
fetch-depth: 0 |
| 24 |
|
| 25 |
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 26 |
with: |
| 27 |
# Stay on 3.13 until https://github.com/samuelcolvin/check-python-version/issues/3 is fixed: |
| 28 |
python-version: '3.13' |
| 29 |
enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions |
| 30 |
|
| 31 |
- run: uv sync --group docs |
| 32 |
|
| 33 |
- name: Set git credentials |
| 34 |
run: | |
| 35 |
git config --global user.name "${GITHUB_ACTOR}" |
| 36 |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" |
| 37 |
|
| 38 |
- run: uv run mike deploy -b docs-site dev --push |
| 39 |
if: github.ref == 'refs/heads/main' |
| 40 |
|
| 41 |
- if: startsWith(github.ref, 'refs/tags/') |
| 42 |
id: check-version |
| 43 |
uses: samuelcolvin/check-python-version@ee87cddb8049d2694cc03badc8569765a05cef00 # v5 |
| 44 |
with: |
| 45 |
version_file_path: pyproject.toml |
| 46 |
skip_env_check: true |
| 47 |
|
| 48 |
- run: uv run mike deploy -b docs-site ${STEPS_CHECK_VERSION_OUTPUTS_VERSION_MAJOR_MINOR} latest --update-aliases --push |
| 49 |
if: (startsWith(github.ref, 'refs/tags/')) && !fromJSON(steps.check-version.outputs.IS_PRERELEASE) |
| 50 |
env: |
| 51 |
PYDANTIC_VERSION: v${{ steps.check-version.outputs.VERSION }} |
| 52 |
STEPS_CHECK_VERSION_OUTPUTS_VERSION_MAJOR_MINOR: ${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} |