Repository navigation
Bump version to 0.1.0rc1 and update project description #6
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: Deploy Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: github-pages-versioned | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| run: python -m pip install --upgrade pip uv==0.11.7 | |
| - name: Publish versioned docs with mike | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git fetch origin gh-pages --depth=1 || true | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| uv run python -m scripts.release.manage_version validate \ | |
| --tag "${GITHUB_REF_NAME}" \ | |
| --require-project-match | |
| if [[ "${VERSION}" == *rc* ]]; then | |
| uv run --group docs mike deploy --push --update-aliases --title "${VERSION}" "${VERSION}" rc | |
| if ! uv run --group docs mike list -j | grep -q '"latest"'; then | |
| uv run --group docs mike set-default --push rc | |
| fi | |
| else | |
| uv run --group docs mike deploy --push --update-aliases --title "${VERSION}" "${VERSION}" | |
| if ! uv run --group docs mike list -j | grep -q '"latest"'; then | |
| uv run --group docs mike deploy --push --update-aliases --title "latest (${VERSION})" latest | |
| fi | |
| uv run --group docs mike set-default --push latest | |
| fi | |
| else | |
| VERSION="$(uv run python -m scripts.release.manage_version show)" | |
| uv run --group docs mike deploy --push --update-aliases --title "latest (${VERSION})" latest | |
| uv run --group docs mike set-default --push latest | |
| fi | |
| git fetch origin gh-pages --depth=1 | |
| rm -rf /tmp/agent-hooks-site | |
| mkdir -p /tmp/agent-hooks-site | |
| git archive --format=tar origin/gh-pages -o /tmp/agent-hooks-site/site.tar | |
| tar -xf /tmp/agent-hooks-site/site.tar -C /tmp/agent-hooks-site | |
| rm /tmp/agent-hooks-site/site.tar | |
| - name: Upload site artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | |
| with: | |
| path: /tmp/agent-hooks-site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |