# Caches and artifacts (/docs/ci-runners/caching)



A runner's filesystem is disposable. Use GitHub Actions cache and artifact actions to retain data between jobs.

## Dependency caches [#dependency-caches]

Keep your existing `actions/cache` usage or a setup action's supported cache option. Use lockfile hashes in cache keys so dependency changes produce a new cache. Cache access and retention follow GitHub's rules and your workflow permissions.

## Docker builds [#docker-builds]

A new job does not inherit a previous machine's Docker layers. Use your build tool's supported remote cache, such as BuildKit's GitHub Actions cache backend, and keep cache scopes appropriate for your repository.

Host-local Docker layer caching, unlimited cache storage, running-service snapshots and cross-run local disks are not part of the current AWS offering.

## Artifacts [#artifacts]

Upload build outputs, reports and files needed by later jobs as GitHub Actions artifacts. Download them explicitly in the receiving job. Never rely on two jobs sharing a machine.

Do not include credentials or secret-bearing files in a cache or artifact. Files produced by untrusted code should be treated as untrusted input.
