fix: enhance file URL handling for cross-platform compatibility #7
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 | |
| # Build the Sphinx documentation and publish it to GitHub Pages. | |
| # - On push to ``main`` and to release tags, the build *and* deploys. | |
| # - On pull requests, the build runs (so doc changes are validated) | |
| # but the deploy step is skipped. | |
| # | |
| # Repository setup required (one-time, in repo Settings → Pages): | |
| # | |
| # Build and deployment → Source: GitHub Actions | |
| # | |
| # After that, the latest run of this workflow becomes the live | |
| # https://<owner>.github.io/<repo>/ site automatically. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - main | |
| # Allow only one concurrent deployment, and cancel in-progress runs | |
| # instead of queuing them. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # checkout | |
| pages: write # deploy-pages | |
| id-token: write # OIDC trust to deploy | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # setuptools-scm needs the full tag history to compute the | |
| # version, and sphinx may include version info in the docs. | |
| fetch-depth: 0 | |
| - name: Setup Miniconda | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| cache-downloads: true | |
| condarc: | | |
| channels: | |
| - conda-forge | |
| create-args: | | |
| python=3.14 | |
| environment-name: ZCollection | |
| environment-file: conda/environment.yml | |
| - name: Stamp version | |
| shell: bash -l {0} | |
| run: | | |
| python -m setuptools_scm | |
| if [[ ! -e zcollection/version.py ]]; then | |
| echo "__version__ = '$(git describe --tags --always)'" \ | |
| > zcollection/version.py | |
| fi | |
| - name: Install zcollection in the env | |
| # sphinx-gallery executes the example files; they import | |
| # ``zcollection`` and need it on the path. | |
| shell: bash -l {0} | |
| run: python -m pip install --no-deps -e . | |
| - name: Build HTML | |
| shell: bash -l {0} | |
| run: python -m sphinx -b html docs/source docs/build/html | |
| - name: Configure Pages | |
| if: github.event_name != 'pull_request' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/build/html | |
| deploy: | |
| name: deploy | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| environment: | |
| # The ``github-pages`` environment is created automatically the | |
| # first time this job runs successfully. | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |