| 1 | name: build-docs
|
| 2 |
|
| 3 | on:
|
| 4 | push:
|
| 5 | branches:
|
| 6 | - main
|
| 7 | - v1
|
| 8 | - "build-docs-*"
|
| 9 | pull_request:
|
| 10 | branches:
|
| 11 | - main
|
| 12 | - v1
|
| 13 |
|
| 14 | # Prevent concurrent runs that could conflict when pushing to gh-pages
|
| 15 | concurrency:
|
| 16 | group: build-docs-${{ github.ref }}
|
| 17 | cancel-in-progress: false
|
| 18 |
|
| 19 | permissions:
|
| 20 | contents: write
|
| 21 | jobs:
|
| 22 | deploy:
|
| 23 | runs-on: ubuntu-latest
|
| 24 | steps:
|
| 25 | - uses: actions/checkout@v6
|
| 26 | with:
|
| 27 | fetch-depth: 0
|
| 28 | - name: Configure Git Credentials
|
| 29 | run: |
|
| 30 | git config user.name github-actions[bot]
|
| 31 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
| 32 | - uses: actions/setup-python@v6
|
| 33 | with:
|
| 34 | python-version: 3.x
|
| 35 | - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
| 36 | - uses: actions/cache@v5
|
| 37 | with:
|
| 38 | key: mkdocs-material-${{ env.cache_id }}
|
| 39 | path: .cache
|
| 40 | restore-keys: |
|
| 41 | mkdocs-material-
|
| 42 | - name: Install uv
|
| 43 | run: |
|
| 44 | curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 45 | - run: uv pip install --python ${Python_ROOT_DIR} '.[full]'
|
| 46 | - name: Deploy v2 Documentation (main)
|
| 47 | if: github.ref == 'refs/heads/main'
|
| 48 | run: mike deploy --push --update-aliases v2 latest
|
| 49 | - name: Deploy v1 Documentation (v1 branch)
|
| 50 | if: github.ref == 'refs/heads/v1'
|
| 51 | run: mike deploy --push v1
|
| 52 | - name: Build Documentation (strict)
|
| 53 | # Do this even if we've already deployed, just so we can catch errors
|
| 54 | # and mark the build as failed.
|
| 55 | run: mkdocs build --strict
|