Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish MkDocs on Release | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Install docs dependencies | |
| run: | | |
| uv sync --group mkdocs | |
| - name: Extract Major and Minor Version | |
| run: | | |
| VERSION_TAG=${{ github.event.release.tag_name }} | |
| VERSION_TAG="${VERSION_TAG#v}" # Remove 'v' prefix if present | |
| MAJOR="${VERSION_TAG%%.*}" | |
| MINOR="${VERSION_TAG#*.}" | |
| MINOR="${MINOR%%.*}" | |
| MAJOR_MINOR_VERSION="${MAJOR}.${MINOR}" | |
| echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV | |
| - name: Deploy Updated Docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| uv run mike deploy --push --message "Deploy docs for release ${{ github.event.release.tag_name }}" --update-alias $MAJOR_MINOR_VERSION latest | |
| uv run mike set-default --push latest |