Deployment And Auth

Purpose and Scope

Deployment and authentication in Turborepo are best understood as the boundary between local task orchestration and shared infrastructure. A workspace can run turbo entirely on a developer machine, but production workflows usually need two extra capabilities: a deployment platform that can understand the monorepo shape, and authenticated access to a shared Remote Cache so builds do not repeat identical work across laptops, CI, and deploy systems. This page explains that boundary for developers and for agent-assisted workflows that need to prepare repositories, CI files, and deployment environments safely.

Sources: apps/docs/content/blog/free-vercel-remote-cache.mdx, apps/docs/content/docs/guides/ci-vendors/vercel.mdx, apps/docs/content/docs/guides/ci-vendors/github-actions.mdx

The first-party docs present Vercel as the simplest deployment target because its integration automatically understands Turborepo monorepos and pre-configures projects to use Vercel Remote Cache. Outside Vercel, authentication becomes explicit: CI systems need TURBO_TOKEN and TURBO_TEAM so turbo can read from and write to the remote cache. The official options guidance also frames authentication as part of the normal invocation model: defaults live in turbo.json, per-environment differences use system environment variables, and per-run overrides use CLI flags, with flags taking precedence.

Sources: apps/docs/content/docs/guides/ci-vendors/vercel.mdx, apps/docs/content/blog/free-vercel-remote-cache.mdx

Relevant Source Files

  • apps/docs/content/blog/free-vercel-remote-cache.mdx — Announces free Vercel Remote Cache and documents the local and CI authentication flows for linking Turborepo to Vercel Remote Cache.
  • apps/docs/content/blog/joining-vercel.mdx — Provides historical context for Vercel-backed zero-config remote caching and the open-source Turborepo CLI.
  • apps/docs/content/docs/guides/ci-vendors/github-actions.mdx — Shows concrete GitHub Actions workflow files, package-manager setup, turbo run scripts, and commented Remote Caching environment variables.
  • apps/docs/content/docs/guides/ci-vendors/vercel.mdx — Documents the Vercel deployment path, where importing the repository creates projects pre-configured for Vercel Remote Cache.
  • apps/docs/content/docs/reference/prune.mdx — Defines turbo prune, including Docker-oriented output that helps create deployable partial monorepos.
  • apps/docs/content/blog/2-10.mdx — Adds operational details relevant to production-like workflows, including graceful task shutdown and commands for installing or updating the Turborepo Agent Skill.

Core Primitives

The deployment primitive is the target environment that executes Turborepo tasks for an application or package. In the supplied docs, that target may be Vercel, GitHub Actions, or a Docker image created from a pruned workspace. Vercel is positioned as zero-configuration: import the code as a new project and the platform understands the Turborepo monorepo and Remote Cache settings. GitHub Actions is more explicit: the workflow installs dependencies with a package manager, runs root scripts such as build and test, and optionally supplies Remote Caching credentials through Actions secrets and variables.

Sources: apps/docs/content/docs/guides/ci-vendors/vercel.mdx, apps/docs/content/docs/guides/ci-vendors/github-actions.mdx

The authentication primitive is the set of credentials and environment state that let a non-local machine participate in the shared cache. The docs name TURBO_TOKEN and TURBO_TEAM for CI providers that are not automatically configured by Vercel. Locally, the equivalent user-facing flow is npx turbo login followed by npx turbo link, which connects the repository to the cache provider. When an agent is asked to prepare deployment, it should treat these values as deployment-time secrets and references, not as source code to commit into the repository.

Sources: apps/docs/content/blog/free-vercel-remote-cache.mdx

The packaging primitive is turbo prune. Deployment often benefits from a smaller workspace than the full monorepo, especially for Docker builds. turbo prune [package] generates an out directory containing the source for the target package’s required internal dependencies, a pruned lockfile, and a copy of the root package.json. With --docker, Turborepo changes the output layout to better support Docker layer caching, separating package metadata from full source so dependency installation can be cached independently from application changes.

Sources: apps/docs/content/docs/reference/prune.mdx

Deployment Flows

For Vercel, the flow is intentionally short. Create a new project in Vercel, import the monorepo, and let the platform pre-configure the project for Vercel Remote Cache. This is the path to prefer when the deployment target is Vercel because the docs describe turbo commands on Vercel as automatically configured to use the cache. The historical Vercel acquisition announcement explains why this integration is central to Turborepo’s product story: Vercel-backed zero-config remote caching became a major part of the CLI’s distribution and hosted workflow.

Sources: apps/docs/content/docs/guides/ci-vendors/vercel.mdx, apps/docs/content/blog/joining-vercel.mdx

For GitHub Actions, the flow is a normal CI pipeline with explicit cache authentication. The example root package.json defines scripts like build as turbo run build and test as turbo run test. The example turbo.json defines build outputs, excludes framework cache folders such as .next/cache/**, and makes build depend on upstream package builds with ^build. The workflow checks out code, installs the selected package manager, configures Node.js caching, installs dependencies, then runs the package-manager scripts that invoke Turborepo.

Sources: apps/docs/content/docs/guides/ci-vendors/github-actions.mdx

name: CI
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
      TURBO_TEAM: ${{ vars.TURBO_TEAM }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: pnpm install
      - run: pnpm build
      - run: pnpm test

For container deployment, start from the prune contract rather than copying the entire monorepo into the image. The reference page says turbo prune [package] emits the full source code needed for the target, a lockfile subset, and root package metadata. That makes the deploy artifact match the dependency graph Turborepo already understands. The --docker option further aligns the generated directory with Docker best practices, which helps avoid reinstalling every dependency when source files change but package metadata does not.

Sources: apps/docs/content/docs/reference/prune.mdx

Auth and Cache Reference

ConcernConcrete source-backed behavior
Local loginRun npx turbo login to authenticate the current machine before linking a repository.
Local linkingRun npx turbo link so the repository can use Vercel Remote Cache locally.
CI tokenSet TURBO_TOKEN in CI secrets when the provider is not Vercel’s zero-config environment.
CI teamSet TURBO_TEAM as the team identifier, commonly from CI variables rather than a secret value.
Vercel deploysImporting a Turborepo project into Vercel pre-configures the project for Vercel Remote Cache.
Docker deploysUse turbo prune [package] and optionally turbo prune [package] --docker to create a smaller deployable workspace.

These items should be applied with the precedence model from the official options documentation in mind: persistent project defaults belong in configuration, environment-specific values belong in system environment variables, and one-off choices belong in CLI flags. Authentication values are naturally environment-specific, so the docs’ GitHub Actions example keeps Remote Caching under workflow env and refers to GitHub secrets or variables. That separation is important for agents too: an automated assistant can add the variable names and comments, but it should ask the operator to provision the actual token in the deployment system.

Sources: apps/docs/content/blog/free-vercel-remote-cache.mdx, apps/docs/content/docs/guides/ci-vendors/github-actions.mdx

Operational Details for Agent-Assisted Workflows

Turborepo 2.10 adds two operational signals that matter when an agent is driving repository work. First, the release notes include installation and update commands for the Turborepo Agent Skill, making the skill part of the documented developer workflow. Second, graceful task shutdown means Turborepo now forwards Ctrl+C, SIGINT, or SIGTERM to running tasks and waits for them to finish cleanup. That is especially relevant for long-running development or preview tasks because background servers, log flushing, and Docker Compose cleanup can complete instead of being abruptly terminated.

Sources: apps/docs/content/blog/2-10.mdx

An agent preparing deployment should therefore model auth, cache, and shutdown as explicit workflow state. Before editing CI, it should identify the package manager and root scripts, then add or preserve turbo run scripts rather than replacing the project’s task graph. Before enabling Remote Caching, it should create references to TURBO_TOKEN and TURBO_TEAM without exposing secret values. Before suggesting Docker changes, it should use turbo prune as the source-backed way to reduce the build context. Before stopping running tasks, it should prefer normal process interruption so Turborepo can forward the signal to child tasks.

Sources: apps/docs/content/docs/guides/ci-vendors/github-actions.mdx, apps/docs/content/docs/reference/prune.mdx, apps/docs/content/blog/2-10.mdx

Next Steps

If you are deploying on Vercel, start with the Vercel guide and confirm that each application is imported as the intended project. If you are deploying through GitHub Actions or another CI system, add TURBO_TOKEN and TURBO_TEAM in the provider’s secret or variable store, then run the existing root scripts that call turbo run. If you are packaging for containers, test turbo prune <package> --docker locally and inspect the generated out directory before writing the Dockerfile around it. For broader context, continue to the Remote Caching, GitHub Actions, Docker, and turbo prune reference pages.