Cache dependencies and build outputs in GitHub Actions
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Cyril Rohr 083b9c47d0
Merge commit 'b2a0330cdf8f73b245abd87c6e608a524d1798fb'
4 months ago
.devcontainer GA for granular cache (#1035) 3 years ago
.github Enable workflow_dispatch 5 months ago
.licenses Update to use the latest version of the cache package to obfuscate the SAS 7 months ago
.vscode Initial commit 6 years ago
__tests__ added unit tests 1 year ago
dist Merge tag 'v4.2.3' into v4 5 months ago
restore Merge branch 'main' into todgru/v4-documentation-update 1 year ago
save docs: Make the "always save prime numbers" example more clear (#1525) 10 months ago
src Merge tag 'v4.2.3' into v4 5 months ago
.eslintrc.json Update eslint and prettier 4 years ago
.gitattributes Fix line ending for windows test 4 years ago
.gitignore test e2e during workflow (#185) 6 years ago
.licensed.yml Add licensed output 11 months ago
.prettierrc.json Initial commit 6 years ago
CODE_OF_CONDUCT.md Fix repo name in contact email (#41) 6 years ago
CONTRIBUTING.md Update contributing.md 5 years ago
LICENSE Initial commit 6 years ago
README.md Add 3.4.0 release notes 11 months ago
RELEASES.md Update releases.md 7 months ago
action.yml Merge tag 'v4.2.3' into v4 5 months ago
caching-strategies.md Correct GitHub Spelling in caching-strategies.md (#1526) 10 months ago
examples.md Add Bun example (#1456) 1 year ago
jest.config.js Resolve dependabot alerts 4 years ago
package-lock.json Merge tag 'v4.2.3' into v4 5 months ago
package.json Merge tag 'v4.2.3' into v4 5 months ago
tips-and-workarounds.md Update force deletion docs due a recent deprecation (#1500) 9 months ago
tsconfig.json Initial commit 6 years ago

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.