Launch Templates

You can find built-in launch templates here.

The easiest way to create a new custom launch template is to modify one of the built-in ones. To do that, create a file in the .nx/workflows folder and copy one of the built-in templates there. You can name the file any way you want (e.g., agents.yaml).

This is an example of a launch template using all built-in features:

1launch-templates: 2 my-linux-medium-js: 3 resourceClass: '' 4 image: 'ubuntu22.04-node20.9-v1' 5 env: MY_ENV_VAR=shared 6 init-steps: 7 - name: Checkout # using a reusable step 8 uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/checkout/main.yaml' 9 - name: Restore Node Modules Cache 10 uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/cache/main.yaml' 11 env: 12 KEY: 'package-lock.json|yarn.lock|pnpm-lock.yaml' 13 PATHS: 'node_modules' 14 BASE_BRANCH: 'main' 15 - name: Install Node Modules 16 uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/install-node-modules/main.yaml' 17 - name: Run a custom script 18 git config --global user.email test@test.com 19 git config --global user.name "Test Test" 20 - name: Setting env # Redefine PATH for further steps 21 script: echo "PATH=$HOME/my-folder:$PATH" >> $NX_CLOUD_ENV 22 - name: Print path 23 script: echo $PATH # will include my-folder 24 - name: Define env var for a step 25 env: MY_ENV_VAR=for-step 26 script: echo $MY_ENV_VAR # will print for-step 27

Resource Classes

The following resource classes are available:

  • docker_linux_amd64/small
  • docker_linux_amd64/medium
  • docker_linux_amd64/medium+
  • docker_linux_amd64/large
  • docker_linux_amd64/large+
  • docker_linux_amd64/extra_large
  • docker_linux_amd64/extra_large+

See their detailed description and pricing at nx.app/pricing.

Image

The following images are available:

  • ubuntu22.04-node20.9-v1
  • ubuntu22.04-node20.9-withDind-v1
  • ubuntu22.04-node20.9-v2
  • ubuntu22.04-node20.9-withDind-v2

Enterprise accounts can use custom images.

Reusable Steps

You can find the list of reusable step here.