diff --git a/docs/nx-cloud/intro/ci-with-nx.md b/docs/nx-cloud/intro/ci-with-nx.md index 747cdcab7c4a62..3cde8274543191 100644 --- a/docs/nx-cloud/intro/ci-with-nx.md +++ b/docs/nx-cloud/intro/ci-with-nx.md @@ -14,6 +14,10 @@ Implementing an efficient CI setup for monorepos - while crucial - can be challe [Create an account on Nx Cloud](https://cloud.nx.app) and connect your repository. +```shell +npx nx connect +``` + ## Learn about Nx on CI {% cards cols="2" lgCols="4" mdCols="4" smCols="2" %} diff --git a/docs/nx-cloud/intro/why-nx-cloud.md b/docs/nx-cloud/intro/why-nx-cloud.md index 40e0a561d71366..2e96a5cd9aadfa 100644 --- a/docs/nx-cloud/intro/why-nx-cloud.md +++ b/docs/nx-cloud/intro/why-nx-cloud.md @@ -31,7 +31,11 @@ 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. Read more about all the details [on this doc page](/ci/recipes/set-up/connect-to-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** @@ -40,13 +44,20 @@ This can be done by signing up on [nx.app](https://nx.app) and then connecting t run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"' ``` -Check out our [recipes for the various CI providers](/ci/recipes/set-up). +Let us generate the workflow file for you. + +```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 command as usual** +**Step 3: Run your Nx commands as usual** ```yml - run: npx nx-cloud record -- nx format:check -- run: npx nx affected -t lint test build e2e-ci +- 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. diff --git a/docs/nx-cloud/recipes/connect-to-cloud.md b/docs/nx-cloud/recipes/connect-to-cloud.md index 5311911815aff3..0c5e3ff094648d 100644 --- a/docs/nx-cloud/recipes/connect-to-cloud.md +++ b/docs/nx-cloud/recipes/connect-to-cloud.md @@ -1,33 +1,9 @@ # Connect to Nx Cloud -Create an account on [nx.app](https://nx.app). There are several ways to connect your repository to Nx Cloud. - -#### Connect Directly Through GitHub - -If your repository is hosted on GitHub, we recommend you create an Nx Cloud organization based on your GitHub organization. - -![Connect Your VCS Account](/nx-cloud/tutorial/connect-vcs-account.png) - -After that, connect you repository. - -![Connect Your Repository](/nx-cloud/tutorial/connect-repository.png) - -This will send a pull request to your repository that will add the `nxCloudAccessToken` property to `nx.json`. - -![Nx Cloud Setup PR](/nx-cloud/tutorial/nx-cloud-setup-pr.png) - -This wires up all the CI for you and configures access. Folks who can see your repository can see your workspace on nx.app. - -## Manually Connect Your Workspace - -If your repository is hosted on a different source control provider, you can also connect to Nx Cloud manually. You'll need to add a source control integration later to enable [Nx Agents](/ci/features/distribute-task-execution). - -Run the following command in your repository: +Create an account on [nx.app](https://nx.app) and then connect to your git repository. ```shell -pnpm nx connect +npx nx connect ``` -Click the link in the terminal to claim your workspace on [nx.app](https://nx.app). - -The command generates an `nxCloudAccessToken` property inside of `nx.json`. This is a read-only token that should be committed to the repository. +Follow the prompts to finish the setup.