61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Build and Publish Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
# Ensure only one concurrent deployment
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref}}
|
|
cancel-in-progress: true
|
|
|
|
# Restrict permissions by default
|
|
permissions:
|
|
contents: write # Required for committing to gh-pages
|
|
pages: write # Required for deploying to Pages
|
|
pull-requests: write # Required for PR comments
|
|
|
|
jobs:
|
|
docs-build-deploy:
|
|
name: Publish Docs
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: 📥 Checkout the repository
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: 🐍 Install uv and set Python
|
|
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
|
|
with:
|
|
python-version: "3.10"
|
|
activate-environment: true
|
|
|
|
- name: 🏗️ Install dependencies
|
|
run: uv pip install -r pyproject.toml --group docs
|
|
|
|
- name: ⚙️ Configure git for github-actions
|
|
run: |
|
|
git config --global user.name "${{ github.actor }}"
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
|
|
- name: 🚀 Deploy Development Docs
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') || github.event_name == 'workflow_dispatch'
|
|
env:
|
|
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
uv run mike deploy --push develop
|
|
|
|
- name: 🚀 Deploy Release Docs
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
env:
|
|
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
|
|
uv run mike deploy --push --update-aliases $latest_tag latest
|