Skip to content
Back to Knowledge Base

CI Workflow Examples by Provider

Each workflow below runs nx affected with remote caching and distributes tasks on Nx Agents. For GitHub Actions and a step-by-step walkthrough, see setting up CI.

From PNPM Workspaces to Distributed CI

Watch full course

Every example uses the same .nx/ci-config.yaml:

.nx/ci-config.yaml
dte:
distribute-on: 3 linux-large-js
lifecycle:
stop-after:
- build

Each workflow starts the agents with nx-cloud start-nx-agents before installing dependencies, so agents boot while the main job installs. To see how each provider works out the commit range for nx affected, see set the affected base commit in CI.

Generate a starting workflow with nx g ci-workflow --ci=circleci, or start from this one:

.circleci/config.yml
version: 2.1
orbs:
nx: nrwl/nx@1.7.0
jobs:
main:
docker:
- image: cimg/node:lts-browsers
steps:
- checkout
- run: npx nx-cloud start-nx-agents
- run: npm ci
- nx/set-shas:
main-branch-name: 'main'
- run:
command: npx nx affected -t lint test build
workflows:
version: 2
ci:
jobs:
- main

For every .nx/ci-config.yaml option, see the CI configuration file reference.

Last updated: