From 446d0973e6fab757bcf237b929fb68feacff5dc1 Mon Sep 17 00:00:00 2001 From: Dan Snow <31494343+dfsnow@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:48:53 -0600 Subject: [PATCH] Cache pages builds (#30) * Cache pages after build * Add tmate action * Add restore mtime * Switch to caching Jupyter builds * Drop tmate action --- .github/workflows/pages.yaml | 13 +++++++++++-- docs/source/conf.py | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 1423c38..43f69a8 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -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 @@ -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' diff --git a/docs/source/conf.py b/docs/source/conf.py index dc8350a..2a71cd3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,3 +14,4 @@ nb_render_image_options = {"width": "450px", "align": "center"} nb_execution_timeout = 600 html_sidebars = {"**": []} +jupyter_execute_notebooks = "cache"