Manual Documentation Publish #2
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: "Manual Documentation Publish" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| RELEASE_VERSION: | |
| required: false | |
| type: string | |
| default: "" | |
| description: "Release version (e.g. 0.4.0). Leave blank to use the current version from pyproject.toml." | |
| UPDATE_LATEST: | |
| required: true | |
| type: boolean | |
| default: true | |
| description: "Update the 'latest' alias to point to this version" | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy-docs: | |
| name: Deploy Documentation | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: deploy-docs | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install docs dependencies | |
| run: uv sync --group docs | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| INPUT_VERSION="${{ inputs.RELEASE_VERSION }}" | |
| if [ -z "$INPUT_VERSION" ]; then | |
| VERSION=$(uv run python -c "from agentomatic._version import __version__; print(__version__)") | |
| echo "Auto-detected version: ${VERSION}" | |
| else | |
| VERSION="$INPUT_VERSION" | |
| echo "Using provided version: ${VERSION}" | |
| fi | |
| echo "value=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Configure git | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Deploy versioned docs | |
| run: | | |
| VERSION="${{ steps.version.outputs.value }}" | |
| echo "Deploying documentation for version ${VERSION}" | |
| git fetch origin gh-pages:gh-pages --force || echo "No gh-pages branch exists yet — mike will create it" | |
| if [[ "${{ inputs.UPDATE_LATEST }}" == "true" ]]; then | |
| uv run mike deploy --push --update-aliases --ignore-remote-status "$VERSION" latest | |
| uv run mike set-default --push --ignore-remote-status latest | |
| echo "✓ Deployed v${VERSION} as 'latest' (set as default)" | |
| else | |
| uv run mike deploy --push --ignore-remote-status "$VERSION" | |
| echo "✓ Deployed v${VERSION} (latest alias NOT updated)" | |
| fi | |
| - name: List deployed versions | |
| run: | | |
| echo "📚 All deployed documentation versions:" | |
| uv run mike list || echo "Could not list versions" |