Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cgrindel/gha_set_up_action_cache
GitHub Action to configure an action cache.
https://github.com/cgrindel/gha_set_up_action_cache
Last synced: 7 days ago
JSON representation
GitHub Action to configure an action cache.
- Host: GitHub
- URL: https://github.com/cgrindel/gha_set_up_action_cache
- Owner: cgrindel
- License: apache-2.0
- Created: 2022-01-07T18:46:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T18:04:53.000Z (3 months ago)
- Last Synced: 2025-01-05T14:42:43.383Z (13 days ago)
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Set Up Action Cache GitHub Action
GitHub Action to configure an action cache with restore keys that consist of a prefix, the runner
OS, a cache name, and a suffix.## Quickstart
Typically, a workflow will set up a cache directory to save workflow artifacts between runs. The
selection of values for the `key_prefix`, the `cache_name`, and the `key_suffix` are related to how
you want to the cache to match/invalidate. One should set the `cache_name` to a stable, meaningful
value. The `key_suffix` should be set to an expression that hashes a meaningful set of files in the
repository. The `key_prefix` need only be set if/when it is necessary to invalidate all previous
cache values.See [actions/cache](https://github.com/actions/cache) for more details.```yaml
jobs:
ubuntu_build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2- name: Test Cache for CI
uses: cgrindel/gha_set_up_action_cache@v1
with:
path: ~/.cache/my_cache
key_prefix: "2022-01-10T16:19:15"
cache_name: gha_set_up_action_cache_ci
key_suffix: ${{ hashFiles('**/foo.lock') }}
```