Shipfox
Shipfox Caching

Turborepo

Speed up your Turborepo monorepo builds with Shipfox's built-in remote cache, colocated with your runners

Turborepo is a high-performance build system for JavaScript and TypeScript monorepos. Its remote caching feature allows build artifacts to be shared across machines and CI runs, so tasks that have already been computed are never run twice.

Shipfox provides a built-in Turborepo-compatible remote cache colocated with your runners. Artifacts are stored and served from the same infrastructure as your CI jobs, giving you near-instant cache hits with no configuration changes.

How it works

When a Turborepo task completes, its output is uploaded to the remote cache server keyed by a hash of the task inputs. On subsequent runs, Turbo checks the remote cache before executing: if the inputs haven't changed, it downloads the cached output and replays it instead of recomputing.

Shipfox exposes a Turborepo-compatible API endpoint on every runner at $SHIPFOX_TURBOREPO_URL. In automatic mode, the required variables are pre-configured before your job starts so turbo picks up the cache transparently.

Automatic setup

When automatic caching is enabled, Shipfox pre-configures the following environment variables on every runner:

VariableValue
TURBO_APIShipfox's cache endpoint
TURBO_TEAMshipfox
TURBO_TOKENshipfox

Your workflow runs turbo commands exactly as they are, no changes needed.

- name: Install dependencies
  run: npm install

- name: Build
  run: npx turbo run build

Automatic caching is enabled by default. You can disable it per tool from your Organization Settings in the Shipfox dashboard if you prefer to manage the configuration yourself.

Manual setup

If you want full control over the cache configuration, use the $SHIPFOX_TURBOREPO_URL environment variable exposed on every runner and set the Turborepo variables yourself.

- name: Configure Turborepo remote cache
  run: |
    echo "TURBO_API=$SHIPFOX_TURBOREPO_URL" >> "$GITHUB_ENV"
    echo "TURBO_TEAM=${{ github.repository_owner }}" >> "$GITHUB_ENV"
    echo "TURBO_TOKEN=shipfox" >> "$GITHUB_ENV"

- name: Install dependencies
  run: npm install

- name: Build
  run: npx turbo run build

TURBO_TEAM acts as a namespace for cached artifacts. Use a consistent value (such as your GitHub organization name) so cache is shared across runs and jobs. Using a unique value per run (such as ${{ github.run_id }}) effectively disables cross-run caching.

TURBO_TOKEN must be set to a non-empty string. The Shipfox cache server accepts any value; shipfox is a sensible default.