Skip to main content
GitHub Actions workflows on Ravion can use three storage layers: On sandboxes, the disk cache usually makes path caches unnecessary; keep actions/cache steps if you also run the workflow elsewhere.

Disk cache

On sandboxes, disk_cache=auto is the default for GitHub Actions jobs, so you don’t need to add it to the label. Pipeline steps default to off. When a job ends, Ravion saves the sandbox’s whole disk, and the job’s next run starts with it: packages, installed tools, node_modules, Docker layers and your checkout. See Why sandboxes are fast.
  • With auto, a run restores the disk saved for its branch. If there’s none, it uses the pull request’s base branch, then the repository’s default branch. It saves to its own branch.
  • A run saves its disk when the job succeeds, or runs to its end and fails. A job that’s canceled, loses its host, or writes past its disk limit saves nothing.
  • On the default branch, only runs from triggers GitHub trusts for caches, such as push, schedule and workflow_dispatch, save. Runs from pull_request_target, issue_comment or workflow_run only read.
  • A key shares one disk across branches, so only default-branch runs from those trusted triggers save to it. Runs on other branches and tags only read it.
  • With auto, a run on a tag keeps its own disk, apart from any branch with the same name. It restores the default branch’s disk when it has none.
  • A run whose commit Ravion can’t place on its branch or tag, such as a run of a tag deleted before the job started, neither restores nor saves a disk.
  • A job with GitHub’s cache-mode: read or cache-mode: none never saves its disk.
  • In private repositories, pull requests from forks never restore or save a disk.
  • Public repositories keep their disks apart from your private repositories. See Public repositories.
Keep disk_cache on when a job fails. Turning it off doesn’t fix install, permission or tool-version errors, and it makes every run start cold. Fix the error the failing step reports instead. Only turn the cache off for a job when files restored from an earlier run are shown to cause the failure.

What Docker keeps between runs

Each job starts with no containers and no networks of its own, as on GitHub-hosted runners, so a docker run --name postgres or docker network create smoke that worked on the last run works again. When Ravion saves the disk, it keeps what makes Docker fast and removes what a job creates and expects to be gone: Images that no container in the run used, and that the run didn’t pull, build, load, import or tag, are removed too. Because named volumes are removed, a docker compose up starts with empty databases on every run. To keep volumes between runs, set the Actions configuration variable RAVION_KEEP_DATABASES to 1 for the repository, organization or environment. Setting it with env: in the workflow has no effect.

What packages and services keep between runs

The disk cache keeps the whole root filesystem, not only your workspace. Packages a job installs with apt-get or dpkg stay installed, and systemd units it enables stay enabled. A service from one of those packages can be stopped, or not yet started, when the next run begins. PostgreSQL and MySQL are the exception: Ravion stops them and puts their data back to the image’s after every run, unless RAVION_KEEP_DATABASES is set. Installing a package that’s already installed doesn’t always restart its service. For example, dpkg -i of the Pritunl client on a restored disk leaves its daemon stopped, so the next command fails:
Restart the service yourself and wait until it’s ready before you use it:
Or purge the package first, so each run installs it as on an empty machine:

Keep restored files at checkout

actions/checkout runs git clean -ffdx by default, which deletes ignored files such as node_modules and build output that the disk cache restored. Set clean: false to keep them:
Leave the default for jobs that publish, deploy or check that the tree is clean. Because each run starts with the last run’s files, steps that expect an empty folder can fail from the second run on, such as mkdir without -p or git clone into a folder that exists. See Make steps work on a kept workspace. Files that a Docker container writes into the workspace through a bind mount keep the container user’s owner, so the next run’s job user may not be able to delete them. For example, a docker run -v "$GITHUB_WORKSPACE/pgsock:/var/run/postgresql" postgres step leaves the socket directory owned by the container’s postgres user, and a later rm -rf pgsock fails with Operation not permitted. Before each job, Ravion removes Unix sockets left in the workspace and the job’s home, together with PostgreSQL’s <socket>.lock files next to them, because a socket from an earlier run can’t be reused. Other files keep their owner, so remove the container first and delete its files with sudo:

Actions cache

On sandboxes, actions/cache and actions that use the GitHub Actions cache API work without workflow changes. Ravion stores entries in the actions-cache/ prefix of an S3 bucket in your account and keeps a hot copy on the host disk. Cache reads try the job’s branch, then the pull request’s base branch, then the repository’s default branch. Writes go to the job’s own branch. A run on a tag reads and writes the tag’s own entries, apart from any branch with the same name, then reads the default branch’s. On the default branch, only trusted triggers such as push, schedule and workflow_dispatch can write; other events can read only. Existing keys aren’t overwritten. When several jobs save the same key at once, one save wins and the others skip saving without failing, as on GitHub. actions/cache logs Failed to save: Unable to reserve cache with key …, another job may be creating this cache., and Buildx cache-to: type=gha skips the layers another build is already writing. You don’t need ignore-error=true for this. One difference from GitHub remains: jobs on different hosts that save the same key at the same moment can both upload. The first upload to finish is kept, and neither job fails. GitHub’s cache-mode controls whether a job restores or saves entries: Keys can be up to 512 characters. Entries can be up to 10 GiB and expire seven days after their last use. Restores are near-instant when the files are already on the restored disk. Go builds use the same cache automatically through GOCACHEPROG unless you set your own. Rust builds that use sccache share the same cache too. Ravion sets SCCACHE_WEBDAV_ENDPOINT for every sandbox job, so jobs that already set RUSTC_WRAPPER=sccache get cache hits without changes. A cache backend set in your workflow, such as SCCACHE_BUCKET or SCCACHE_GHA_ENABLED, still takes precedence. C and C++ builds that use ccache 4.4 or later share the same cache. The sandbox image includes ccache, and Ravion points its remote storage at the cache for every sandbox job. Builds still have to call the compiler through ccache, for example with CC="ccache gcc" or CMake’s CMAKE_C_COMPILER_LAUNCHER=ccache. A remote_storage or secondary_storage setting in your ccache.conf, or a CCACHE_REMOTE_STORAGE, CCACHE_SECONDARY_STORAGE or CCACHE_CONFIGPATH2 variable, still takes precedence. Gradle builds that enable the build cache, with --build-cache or org.gradle.caching=true, share the same cache. Ravion adds it as the remote build cache unless your settings already configure one. Builds that don’t enable the build cache are unchanged. Turborepo builds share the same cache without workflow changes. Ravion sets TURBO_API and TURBO_TOKEN for every sandbox job, so turbo run reports Remote caching enabled and replays task outputs that another job, another branch or a fresh disk already built, within the build cache scope. In turbo.json, declare every file a task creates in its outputs, because a cache hit restores only declared outputs. Also declare every environment variable that changes a task’s result in its env, and any file outside the package in its inputs, because Turborepo leaves undeclared ones out of the cache key and could replay output built with different settings. A TURBO_API, TURBO_TOKEN or TURBO_TEAM set in your workflow still takes precedence, so a Vercel Remote Cache keeps working. To keep a job on its local cache only, run turbo run --cache=local:rw. Bazel builds share the same cache without workflow changes. The sandbox image includes Bazelisk as bazel, which runs the Bazel version in your .bazelversion, and Ravion adds the cache to every bazel build, test, run and coverage. Bazel still downloads every output, so later steps find the same files in bazel-bin as without a cache. Ravion leaves Bazel alone when your workspace already sets a remote cache or a remote executor, in .bazelrc, its imports, ~/.bazelrc or on the command line. To turn it off for a job, set RAVION_BAZEL_CACHE=off. If the cache is unreachable, these tools build without it. Nx remote caches aren’t filled in.

Build cache scope

Go, sccache, ccache, Gradle, Turborepo and Bazel share one build cache, scoped like the Actions cache:
  • A job reads outputs from its own branch, then the pull request’s base branch, then the repository’s default branch. If all three miss, a pull_request or push job on a branch other than the default branch or a release branch also reads outputs other branches uploaded recently. See Shared build outputs between branches.
  • A job writes outputs to its own branch. On the default branch, only trusted triggers such as push, schedule and workflow_dispatch write.
  • When a pull request merges, its branch’s outputs become readable from the branch it merged into. Branches cut from it afterwards start warm.
  • cache-mode applies the same way it does to the Actions cache.

Shared build outputs between branches

Jobs on different branches of a repository reuse each other’s build outputs. Two open pull requests that build the same packages share their results, without waiting for one of them to merge. A pull_request or push job on a branch other than the default branch looks up outputs in its own branch, the pull request’s base branch and the default branch first. Only if all of them miss does it also read outputs that other branches of the same repository uploaded recently.
  • Writes still go to the job’s own branch, so merges work as before.
  • Jobs on the default branch never read other branches’ outputs, so a pull request can’t change what default-branch builds restore.
  • Jobs that may publish never read them either: runs on tags, release events, branches named release, releases/..., release/... or release-..., and triggers other than pull_request and push, such as workflow_dispatch.
  • Only recent uploads are shared, so it helps most with work done in the last few hours.
  • It applies to the build cache only. The Actions cache and disk cache stay scoped to the branch. Pipeline steps and public repositories aren’t affected.
  • Pull requests from forks don’t use it.
Any branch can supply outputs that another branch’s jobs restore, so check that your build tools key outputs on everything that changes them. For Turborepo, that means complete outputs, env and inputs in turbo.json. Pipeline sandbox steps with a git source use the same cache for Go, Rust, Turborepo and Bazel builds; see shared build cache for pipeline steps. Public repositories get a separate cache per repository and can’t read private caches. EC2 runners use GitHub’s cache.

Docker build caches

Docker layers and Buildx state on the job’s disk come back with the disk cache, so repeat builds on the same branch are usually warm without any cache settings. To share a Buildx cache between branches or jobs, use type=gha. It goes through the Actions cache and needs no credentials:
type=inline also works, but it’s stored in the image you push. A registry cache (type=registry), for example in Amazon ECR, needs a registry login first, because Docker isn’t logged in to any registry when a job starts. See Amazon ECR.

Artifacts

Artifacts work on all Ravion runners. Use actions/upload-artifact and actions/download-artifact v4 or later as usual. By default, GitHub stores the artifacts, and its retention and limits apply. On sandboxes, you can keep artifacts in S3 in your own AWS account instead. Uploads and downloads then stay inside AWS, so you don’t pay GitHub artifact storage or move artifact data out of AWS on every upload and download. If a sandbox job is rerun after its host is lost, Ravion replaces an artifact uploaded by the earlier attempt of that same job so the rerun’s upload succeeds. Other artifact name conflicts are unchanged.

Store artifacts in S3

  1. Go to Settings / Execution environments, choose the environment, then open Config / Sandboxes.
  2. Set GitHub Actions artifacts to S3.
You can also set githubActionsArtifactStorage to S3 on the environment’s sandbox pool with the API. The change applies from the next job. Workflows don’t change. Ravion creates a bucket named ravion-artifacts-<execution environment ID> in the environment’s AWS account and region. It’s separate from the bucket that holds the disk cache and Actions cache, so artifacts keep their own retention and access. Creating it needs AWS account role policy 1.0.62 or later. With an older policy, saving the setting fails with an error that names the bucket. The download links need policy 1.0.71 or later. To update the policy, go to Settings / AWS accounts, open the account and click Update AWS Permissions. How artifacts are kept:
  • Layout. Objects are keyed by retention, repository, workflow run and attempt, job and artifact name. Pull requests from forks and other untrusted jobs keep their artifacts apart from trusted jobs of the same repository.
  • Retention. An artifact is kept for at least the retention-days it sets, or 90 days when it sets none, as on GitHub. Ravion rounds up to the nearest of 1, 3, 7, 14, 30, 60, 90, 180 or 400 days, and an S3 lifecycle rule deletes it after that. Incomplete uploads are cleaned up after one day.
  • Access. Only jobs on this environment’s sandboxes read and write the bucket. A job can only read, replace or delete its own workflow run’s artifacts.
  • Deleting the environment. Its artifacts are deleted seven days later, so you can undo a delete made in error.

Download artifacts kept in S3

Artifacts kept in S3 don’t appear on the workflow run’s page on GitHub. Instead, at the end of each job that uploaded artifacts, Ravion lists them with their sizes and download links in the job log, and adds a table of links to the job’s summary. Opening a link requires signing in to Ravion. It redirects to an S3 link that expires after five minutes and is signed by a read-only role in your account, rvn-sandbox-host-<execution environment ID>-artifacts, so the download comes straight from your bucket. An archived artifact downloads as <name>.zip. One uploaded with archive: false keeps its own file name and type. An artifact past its retention returns a 404. From the CLI, pass the key printed in the job log:
See ravion execution-environment download-artifact.

What finds artifacts kept in S3

actions/download-artifact in a later job of the same workflow run finds artifacts from both S3 and GitHub, including after Re-run failed jobs. A job that uploads an artifact under a name already used by an earlier attempt shadows the earlier copy, as on GitHub. These don’t see artifacts kept in S3:
  • Jobs on GitHub-hosted runners, EC2 runners or another execution environment’s sandboxes.
  • gh run download, GitHub’s REST API and the workflow run’s page on GitHub.
  • actions/download-artifact with run-id set to another workflow run.
If a workflow needs one of these, keep its artifacts on GitHub. The github-pages artifact always goes to GitHub so actions/deploy-pages keeps working. If the bucket can’t take an upload, for example right after you switch to S3, that artifact goes to GitHub instead and the upload doesn’t fail. Switching back to GitHub applies from the next job. Jobs on the environment’s sandboxes still find artifacts already in the bucket until they expire.