mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-08-04 15:44:09 +00:00
541bfeb1a4
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- run: uv sync --group dev
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Deploy documentation
|
|
run: |
|
|
VERSION=${GITHUB_REF_NAME#v}
|
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
|
DEPLOY_VERSION="v$(echo "$VERSION" | cut -d. -f1-2)"
|
|
|
|
# On new major: keep only the latest feature version of the previous major
|
|
PREV_MAJOR=$((MAJOR - 1))
|
|
OLD_FEATURE_VERSIONS=$(uv run mike list 2>/dev/null | grep -oE "^v${PREV_MAJOR}\.[0-9]+" || true)
|
|
|
|
if [ -n "$OLD_FEATURE_VERSIONS" ]; then
|
|
LATEST_PREV=$(echo "$OLD_FEATURE_VERSIONS" | sort -t. -k2 -n | tail -1)
|
|
echo "$OLD_FEATURE_VERSIONS" | while read -r OLD_V; do
|
|
if [ "$OLD_V" != "$LATEST_PREV" ]; then
|
|
echo "Deleting $OLD_V"
|
|
uv run mike delete "$OLD_V"
|
|
fi
|
|
done
|
|
fi
|
|
|
|
uv run mike deploy --update-aliases "$DEPLOY_VERSION" stable
|
|
uv run mike set-default stable
|
|
git push origin gh-pages
|