nx/docs/nx-cloud/intro/connect-to-cloud.md
Isaac Mann a0baab0d47
docs(core): update nx connect feature page (#26957)
Fix the title of "Connect to Nx Cloud" to be consistent

Old inconsistent titles:
![Screenshot 2024-07-16 at 10 09
47 AM](https://github.com/user-attachments/assets/8122aa79-edaf-46a9-b278-a3c4e2fa214d)

Also adds a sentence explaining the `nx-cloud record` line in step 3,
since that isn't obvious what it is doing.
2024-07-17 08:08:12 -04:00

45 lines
1.4 KiB
Markdown

# Connect to Nx Cloud
Nx Cloud directly integrates with your existing CI setup.
![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp)
In a nutshell, here's how this works:
**Step 1: Connect your workspace to Nx Cloud**
This can be done by signing up on [nx.app](https://nx.app) and then connecting to your git repository.
```shell
npx nx connect
```
**Step 2: Your CI script triggers Nx Cloud**
```yml
- name: Start CI run
run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"'
```
Let us generate the workflow file for you, if you don't already have one.
```shell
npx nx g ci-workflow
```
Or, check out our [recipes for the various CI providers](/ci/recipes/set-up).
**Step 3: Run your Nx commands as usual**
```yml
- run: npx nx-cloud record -- node tools/custom-script.js
- run: npx nx affected -t lint test build
- run: npx nx affected -t e2e-ci --parallel 1
```
All these commands are automatically picked up by Nx Cloud, split up into smaller tasks and distributed across the specified number of machines. Nx Cloud works with Nx tasks automatically, or you can [record non-Nx commands with `nx-cloud record`](/ci/recipes/other/record-commands).
**Step 4: All results are played back automatically**
Nx Cloud automatically plays back all results to your CI system, as if distribution never happened. You can continue doing post-processing on the results, like uploading test reports, deploying artifacts etc.