Cache dependencies and build outputs in GitHub Actions
 
 
 
Go to file
Cyril Rohr 4a6341e149
Merge pull request #37 from runs-on/fix/test-container
Add test for container job
2025-06-24 11:56:32 +02:00
.devcontainer GA for granular cache (#1035) 2022-12-21 19:38:44 +05:30
.github Merge pull request #37 from runs-on/fix/test-container 2025-06-24 11:56:32 +02:00
.licenses Update to use the latest version of the cache package to obfuscate the SAS 2025-03-18 07:58:36 -07:00
.vscode Initial commit 2019-10-30 14:48:49 -04:00
__tests__ added unit tests 2024-10-18 17:22:08 +00:00
dist Merge tag 'v4.2.3' into v4 2025-05-27 14:14:08 +02:00
restore Merge branch 'main' into todgru/v4-documentation-update 2024-08-14 12:09:56 +02:00
save docs: Make the "always save prime numbers" example more clear (#1525) 2025-01-09 23:36:56 +00:00
src Merge tag 'v4.2.3' into v4 2025-05-27 14:14:08 +02:00
.eslintrc.json Update eslint and prettier 2022-01-31 12:55:11 +05:30
.gitattributes Fix line ending for windows test 2022-01-31 13:00:27 +05:30
.gitignore test e2e during workflow (#185) 2020-02-13 12:38:56 -05:00
.licensed.yml Add licensed output 2024-12-04 13:44:43 -08:00
.prettierrc.json Initial commit 2019-10-30 14:48:49 -04:00
CODE_OF_CONDUCT.md Fix repo name in contact email (#41) 2019-11-03 09:38:45 -05:00
CONTRIBUTING.md Update contributing.md 2020-09-23 17:07:50 -04:00
LICENSE Initial commit 2019-10-30 14:48:49 -04:00
README.md Add 3.4.0 release notes 2024-12-05 04:30:22 -08:00
RELEASES.md Update releases.md 2025-03-18 08:00:50 -07:00
action.yml Merge tag 'v4.2.3' into v4 2025-05-27 14:14:08 +02:00
caching-strategies.md Correct GitHub Spelling in caching-strategies.md (#1526) 2025-01-06 16:55:00 +00:00
examples.md Add Bun example (#1456) 2024-10-08 19:53:09 +00:00
jest.config.js Resolve dependabot alerts 2022-01-31 12:06:04 +05:30
package-lock.json Merge tag 'v4.2.3' into v4 2025-05-27 14:14:08 +02:00
package.json Merge tag 'v4.2.3' into v4 2025-05-27 14:14:08 +02:00
tips-and-workarounds.md Update force deletion docs due a recent deprecation (#1500) 2025-02-12 10:49:34 -05:00
tsconfig.json Initial commit 2019-10-30 14:48:49 -04:00

README.md

Shockingly faster cache action

This action is a drop-in replacement for the official actions/cache@v4 action, for use with the RunsOn self-hosted GitHub Action runner provider, or with your own self-hosted runner solution.

image

It will automatically store your caches in a dedicated RunsOn S3 bucket that lives close to your self-hosted runners, ensuring you get at least 200MiB/s download and upload throughput when using caches in your workflows. The larger the cache, the faster the speed.

Also note that you no longer have any limit on the size of the cache. The bucket has a lifecycle rule to remove items older than 10 days.

If no S3 bucket is provided, it will also transparently switch to the default behaviour. This means you can use this action and switch between RunsOn runners and official GitHub runners with no change.

Usage with RunsOn

If using RunsOn, simply replace actions/cache@v4 with runs-on/cache@v4. All the official options are supported.

- - uses: actions/cache@v4
+ - uses: runs-on/cache@v4
    with:
      ...

Please refer to actions/cache for usage.

Usage outside RunsOn

If you want to use this in your own infrastructure, setup your AWS credentials with aws-actions/configure-aws-credentials, then:

  - uses: aws-actions/configure-aws-credentials@v4
    ...
  - uses: runs-on/cache@v4
    with:
      ...
    env:
      RUNS_ON_S3_BUCKET_CACHE: name-of-your-bucket

Be aware of S3 transfer costs if your runners are not in the same AWS region as your bucket.

Special environment variables

  • RUNS_ON_S3_BUCKET_CACHE: if set, the action will use this bucket to store the cache.
  • RUNS_ON_RUNNER_NAME: when running on RunsOn, where this environment variable is non-empty, existing AWS credentials from the environment will be discarded. If you want to preserve existing environment variables, set this to the empty string "".
  • RUNS_ON_S3_FORCE_PATH_STYLE or AWS_S3_FORCE_PATH_STYLE: if one of those environment variables equals the string "true", then the S3 client will be configured to force the path style.