Fix: Use UserWarning for unauthenticated duplicate run checks (Fixes #1210) #2173
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: Docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| tags: | |
| - "v*.*.*" | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: | | |
| pip install -e .[docs,examples] | |
| - name: Make docs | |
| run: | | |
| mkdocs build | |
| - name: Deploy to GitHub Pages | |
| env: | |
| CI: false | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PAGES_BRANCH: gh-pages | |
| if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push' | |
| run: | | |
| git config user.name doc-bot | |
| git config user.email [email protected] | |
| current_version=$(git tag | sort --version-sort | tail -n 1) | |
| # This block will rename previous retitled versions | |
| retitled_versions=$(mike list -j | jq ".[] | select(.title != .version) | .version" | tr -d '"') | |
| for version in $retitled_versions; do | |
| mike retitle "${version}" "${version}" | |
| done | |
| echo "Deploying docs for ${current_version}" | |
| mike set-default latest | |
| mike deploy \ | |
| --push \ | |
| --title "${current_version} (latest)" \ | |
| --update-aliases \ | |
| "${current_version}" \ | |
| "latest"\ | |
| -b $PAGES_BRANCH |