Repository navigation
Merge pull request #319 from claimed-framework/release-v0.5.0 #9
Workflow file for this run
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: Publish Docs to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # publishes the in-development 'dev' docs | |
| tags: | |
| - 'v*' # release tags publish a versioned snapshot + 'latest' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history needed for mike + git-committers plugin | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Install doc dependencies | |
| run: | | |
| pip install \ | |
| mike \ | |
| mkdocs-material \ | |
| mkdocstrings[python] \ | |
| mkdocs-git-revision-date-localized-plugin \ | |
| griffe | |
| - name: Install claimed package (for mkdocstrings introspection) | |
| run: pip install -e . | |
| - name: Configure git identity for mike | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Deploy versioned docs | |
| run: | | |
| set -euo pipefail | |
| # mike commits to the gh-pages branch; make sure we have it locally. | |
| git fetch origin gh-pages --depth=1 || true | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF_NAME#v}" # v0.2.7 -> 0.2.7 | |
| echo "Publishing released version ${VERSION} (alias: latest)" | |
| mike deploy --push --update-aliases "${VERSION}" latest | |
| mike set-default --push latest | |
| else | |
| echo "Publishing in-development docs as 'dev'" | |
| mike deploy --push dev | |
| fi |