jupyter-book
jupyter-book copied to clipboard
DOCS: Ordering of cache step in GH Action YAML example
In the example GitHub Action YAML provided at the bottom of https://jupyterbook.org/en/stable/publish/gh-pages.html, the caching of executable content is placed before the jupyter-book build . command, when there are no outputs to cache at that point. This results in a GH action log message such as
Run actions/cache@v3
Cache not found for input keys: jupyter-book-cache-511116b794a1ce6b75d5156b58ce1314db3e65a10292d7e9f072cad18f7711b3
This PR places the caching step after the jupyter-book build . , which should result in a successful GH action log message such as
Run actions/cache@v3
Cache Size: ~1 MB (1110285 B)
/usr/bin/tar -xf /home/runner/work/_temp/21854ee6-0f37-4c55-9aa7-0f64d703126c/cache.tzst -P -C /home/runner/work/czi-catalystproject.github.io/czi-catalystproject.github.io --use-compress-program unzstd
Cache restored successfully
Cache restored from key: jupyter-book-cache-511116b794a1ce6b75d5156b58ce1314db3e65a10292d7e9f072cad18f7711b3
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:
@jnywong thanks for this PR! I think the current ordering looks correct to me; the cache action should restore any previous artifacts before the book build, so that the build does not execute any notebooks that it does not need to. After the job finishes running, the cache action updates the cache for the next invocation.
Does this match your understanding? I think this documentation change was fairly quick in the process of getting 1.0 out!
Hm okay then it may be the case that if you are generating a cache from a GH action for the first time ever, then we need to store the cached outputs after the book has been built. Then subsequently for all GH actions after that, your logic for pulling the cache before the book build makes sense.
I can do a little more testing to establish this! This was just based on my recent experience on the Catalyst Project website repo.
(Marking this as a draft for now while I test this further)