GitLab CI/CD

How to use Turborepo with GitLab CI/CD


1. Add the secret to your GitLab repository

Go to https://gitlab.com/<ORG>/<REPO>/-/settings/ci_cd and expand the "Variables" section. Create a new variable called TURBO_TOKEN with the value of your API token.

2. Add the env variables to your Github Actions workflow

Create a .gitlab-ci.yml file in the root of your repository and add the following content:

variables:
  # Turborepo
  TURBO_API: "https://cache.turbocache.build"
  TURBO_TOKEN: "$TURBO_TOKEN"
  TURBO_TEAM: "any_name"
  TURBO_RUN_SUMMARY: true
 
stages:
  - build

Replace "any_name" with your actual team name, this can be any name you want. And add your build commands in the script section under the build job.