build: migrate developer tasks to mise #509
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
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - "src/**" | |
| - ".github/workflows/docs.yml" | |
| - ".github/actions/setup-python-env/action.yml" | |
| - ".mise.toml" | |
| - "mise.lock" | |
| - ".mise/tasks/**" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - "src/**" | |
| - ".github/workflows/docs.yml" | |
| - ".github/actions/setup-python-env/action.yml" | |
| - ".mise.toml" | |
| - "mise.lock" | |
| - ".mise/tasks/**" | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: docs-deploy | |
| cancel-in-progress: true | |
| jobs: | |
| build-notebooks: | |
| if: github.event_name == 'release' | |
| uses: ./.github/workflows/build-notebooks.yml | |
| secrets: inherit | |
| deploy: | |
| if: github.event_name != 'release' | |
| name: Deploy docs to GitHub Pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Required to use the reusable action | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: "0" | |
| - uses: ./.github/actions/setup-python-env | |
| with: | |
| checkout: "false" | |
| fetch-depth: "0" | |
| - name: Install docs dependencies | |
| run: mise run install-dev-docs | |
| - name: Configure git for mike | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Build docs | |
| run: mise run docs:build | |
| - name: Deploy docs with mike | |
| if: github.event_name == 'push' | |
| run: uv run --group docs mike deploy --push --update-aliases dev | |
| deploy-release: | |
| if: github.event_name == 'release' | |
| needs: build-notebooks | |
| name: Deploy release docs to GitHub Pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: "0" | |
| - uses: ./.github/actions/setup-python-env | |
| with: | |
| checkout: "false" | |
| fetch-depth: "0" | |
| - name: Install docs dependencies | |
| run: mise run install-dev-docs | |
| - name: Download notebook artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: notebooks | |
| path: docs/notebooks | |
| - name: Configure git for mike | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Build docs | |
| run: mise run docs:build | |
| - name: Deploy release docs with mike | |
| run: | | |
| VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//' | sed 's/ .*$//') | |
| uv run --group docs mike deploy --push --update-aliases "$VERSION" latest |