querkmachine / beeps.website

My personal interweb site where I really just put whatever I want.
https://beeps.website
MIT License
5 stars 0 forks source link

Fix eleventy-fetch-cache not actually being saved #37

Closed querkmachine closed 8 months ago

querkmachine commented 9 months ago

Turns out you can't override a GitHub Actions cache by saving a new one with the same name. How annoying.

Run actions/cache/save@v3
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/beeps.website/beeps.website --files-from manifest.txt --use-compress-program zstdmt
Failed to save: Unable to reserve cache with key eleventy-fetch-cache, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/main, Key: eleventy-fetch-cache, Version: 3869c306e421985623d3b9f9620ba4b83218fd2e7f428ade05f4879e34e22753
Warning: Cache save failed.
querkmachine commented 8 months ago

Ended up following the suggestions in this tips and workarounds document.

It turns out that caches are immutable. Now, when the action is run:

This has the side effect of new caches that are potentially identical being created on every run, but these are garbage collected automatically by GitHub after a couple of weeks. Run times have seemingly gone down from 3–4 minutes to 60–90 seconds, so it's hopefully helping now. 🤞