docs(nx-cloud): update CTA and connect instructions

This commit is contained in:
Juri 2024-08-02 17:48:00 +02:00 committed by Juri Strumpflohner
parent 04af849c66
commit e74db498ca
2 changed files with 14 additions and 10 deletions

View File

@ -4,24 +4,26 @@ Nx Cloud directly integrates with your existing CI setup.
![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp) ![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp)
In a nutshell, here's how this works: Here's how you get set up.
**Step 1: Connect your workspace to Nx Cloud** ## 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. To connect your workspace, **push it to GitHub** (or your respective source control provider) and then run:
```shell ```shell
npx nx connect npx nx connect
``` ```
**Step 2: Your CI script triggers Nx Cloud** ## Step 2: Configure your CI script
If you have CI set up already, configure [distribution with Nx Agents](/ci/features/distribute-task-execution) as follows:
```yml ```yml
- name: Start CI run - name: Start CI run
run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"' 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. Alternatively you can generate the CI configuration using:
```shell ```shell
npx nx g ci-workflow npx nx g ci-workflow
@ -29,16 +31,15 @@ npx nx g ci-workflow
Or, check out our [recipes for the various CI providers](/ci/recipes/set-up). Or, check out our [recipes for the various CI providers](/ci/recipes/set-up).
**Step 3: Run your Nx commands as usual** ## Step 3: Run your Nx commands as usual
```yml ```yml
- run: npx nx-cloud record -- node tools/custom-script.js - run: npx nx-cloud record -- node tools/custom-script.js
- run: npx nx affected -t lint test build - run: npx nx affected -t lint test build e2e-ci
- 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). 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** ## 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. 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.

View File

@ -61,7 +61,10 @@ export default function NxCloudPage(): JSX.Element {
<Statistics /> <Statistics />
</div> </div>
<div className="mt-32 lg:mt-56"> <div className="mt-32 lg:mt-56">
<CallToAction /> <CallToAction
mainActionTitle="Learn more about Nx Cloud on CI"
mainActionLink="/ci/intro/ci-with-nx"
/>
</div> </div>
</DefaultLayout> </DefaultLayout>
); );