Alternative to actions/cache that does not require node
- Shell 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .editorconfig | ||
| action.yml | ||
| README.md | ||
| renovate.json | ||
| tool-cache | ||
Tool cache
A Forgejo Actions composite action that restores and saves a directory in the cache of the Forgejo runner. It runs one bash step with curl, tar and sed, so the job container needs no node.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Restore the tool cache
id: restore
uses: https://git.tweecore.cloud/actions/caching@v1.0.0
with:
mode: restore
key: dev-ops-tool-cache-${{ hashFiles('Makefile') }}
path: .dev-ops/var/cache/download
- name: Save the tool cache
if: steps.restore.outputs.cache-hit != 'true'
uses: https://git.tweecore.cloud/actions/caching@v1.0.0
with:
mode: save
key: dev-ops-tool-cache-${{ hashFiles('Makefile') }}
path: .dev-ops/var/cache/download
restoreprints a notice and continues on a miss or when the runner offers no cache, and sets the outputcache-hit.savefails when the runner offers no cache (ACTIONS_CACHE_URLis empty); enablecache.enabledin the configuration of the Forgejo runner.- Use the same
pathfor restore and save, as given: the entry belongs to that path, so another spelling of the same directory misses. - Only this action reads its own entries: caches saved by
actions/cacheare not restored.