Skip to content

github action to cache artifact on s3

Notifications You must be signed in to change notification settings

rayonapp/s3-cache

Repository files navigation

s3-cache

Drop in replace for actions/cache, cache artifact on s3

Usage

steps:
  - uses: rayonapp/s3-cache
    with:
      path: |
        path/to/file/a
        another/file
        a/directory
      key: cache-${{ hashFiles('**/**.rs') }}
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
      aws-region: ${{ secrets.AWS_REGION }}
      aws-cache-bucket: ${{ secrets.AWS_CACHE_BUCKET }}

Motivation

Handle cache expiration ourselves.

No restriction based on branches, github-restrictions-for-accessing-a-cache

Implementation

  • zip every file (or directory recursively) in path
  • make a zip of all of them
  • upload the resulting zip with cache key as name

About

github action to cache artifact on s3

Resources

Stars

Watchers

Forks

Packages

No packages published