[pre-commit.ci] pre-commit autoupdate #81
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: Build Docs | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - "*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Manual Doc Build | |
| default: run-doc-build | |
| required: false | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| docs: | |
| name: Build & push docs | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 90 | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-latest"] | |
| environment-file: [docs/environment.yaml] | |
| experimental: [false] | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup micromamba | |
| uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| environment-file: ${{ matrix.environment-file }} | |
| micromamba-version: "latest" | |
| - name: Install package | |
| run: pip install . --no-deps | |
| - name: Make docs | |
| run: cd docs; make html | |
| - name: Zip documentation | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: zip docs_artifact.zip docs/build/html -r | |
| - name: Upload artifact | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: docs_artifact | |
| path: docs_artifact.zip | |
| - name: Publish to Github Pages on main (dev) | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/build/html/ | |
| destination_dir: dev | |
| keep_files: false | |
| - name: Publish to Github Pages on release (versioned) | |
| if: ${{ github.ref_type == 'tag' }} | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/build/html/ | |
| destination_dir: ${{ github.ref_name }} | |
| - name: Publish to Github Pages on release (stable) | |
| if: ${{ github.ref_type == 'tag' }} | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/build/html/ | |
| destination_dir: stable | |
| keep_files: false | |
| - name: Update the versions switcher | |
| if: ${{ github.ref_type == 'tag' }} | |
| run: | # yamllint disable-line rule:line-length | |
| git checkout gh-pages | |
| git fetch | |
| git pull | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email \ | |
| '41898282+github-actions[bot]@users.noreply.github.com' | |
| python update_version_json.py --version ${{ github.ref_name }} | |
| git add versions.json | |
| git commit -m "Update versions switcher" | |
| git push | |
| git checkout main |