Public release, 2025-07 #79
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| # Add a button to manually trigger the workflow | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set environment variables | |
| run: | | |
| echo "CURRENT_WEEK=$(date +'%Y-%U')" >> $GITHUB_ENV | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: v1-${{ env.CURRENT_WEEK }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('docs/requirements.txt') }}-${{ hashFiles('requirements-healpix.txt') }}-${{ hashFiles('constraints.txt') }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install uv | |
| # can't use --system here because it doesn't work with --no-build-isolation and a healpix dependency | |
| uv venv --python 3.11 | |
| uv pip install -c constraints.txt -e .[docs] | |
| uv pip install --no-build-isolation -c constraints.txt -e .[docs,healpix] | |
| - name: Build docs | |
| run: | | |
| source .venv/bin/activate | |
| cd docs && make doctest html | |
| - name: Upload to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| deploy: | |
| runs-on: ubuntu-latest | |
| # Only deploy on manual trigger or push to main | |
| if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |