GitHub Pages #237
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: GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y pandoc | |
| uv sync --all-extras --dev | |
| uv pip install -r doc/pages_requirements.txt | |
| - name: List installed | |
| run: | | |
| uv pip list | |
| - name: Build documentation | |
| run: | | |
| cp examples/wcosmo_timing.ipynb doc/source/examples/timing.ipynb | |
| cp examples/wcosmo_gwtc3.ipynb doc/source/examples/gwtc3.ipynb | |
| cp examples/accuracy_comparisons_with_astropy.ipynb doc/source/examples/astropy_comparisons.ipynb | |
| cp examples/integration_method_comparisons.ipynb doc/source/examples/integral_comparisons.ipynb | |
| cd doc | |
| uv run make clean | |
| uv run make html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'doc/build/html' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |