Skip to content

Commit

Permalink
Cache pages builds (#30)
Browse files Browse the repository at this point in the history
* Cache pages after build

* Add tmate action

* Add restore mtime

* Switch to caching Jupyter builds

* Drop tmate action
  • Loading branch information
dfsnow authored Dec 3, 2024
1 parent 494da48 commit 446d097
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
- name: Configure pages
uses: actions/configure-pages@v5

- uses: actions/cache@v4
with:
path: |
_build/.jupyter_cache
_build/jupyter_execute
key: pages-${{ runner.os }}-${{ hashFiles('docs/source/notebooks/**') }}

- name: Install uv
uses: astral-sh/setup-uv@v4

Expand All @@ -31,12 +38,14 @@ jobs:
run: uv pip install .[docs]

- name: Generate HTML
run: uv run sphinx-build -d _build/doctrees docs/source _build/html
run: |
uv run sphinx-build -j auto \
-d _build/doctrees docs/source _build/html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_build/html"
path: _build/html

deploy:
if: contains(fromJSON('["main", "master"]'), github.ref_name) && github.event_name != 'pull_request'
Expand Down
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
nb_render_image_options = {"width": "450px", "align": "center"}
nb_execution_timeout = 600
html_sidebars = {"**": []}
jupyter_execute_notebooks = "cache"

0 comments on commit 446d097

Please sign in to comment.