Skip to content
/ cache Public
forked from actions/cache

Shockingly faster GitHub Action cache with S3 backend

License

Notifications You must be signed in to change notification settings

runs-on/cache

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Shockingly faster GitHub Action cache with S3 backend

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages

  • TypeScript 98.4%
  • Other 1.6%