Run the command like this:

This will fail in CI if any version mismatches are detected. Ensure everything runs locally first using the dev command and don’t bypass the version checks!

It performs a few steps to deploy:

  1. Optionally updates packages when running locally.
  2. Compiles and bundles the code.
  3. Deploys the code to the Trigger.dev instance.
  4. Registers the tasks as a new version in the environment (prod by default).

You can also setup GitHub Actions to deploy your tasks automatically.

Arguments

npx trigger.dev@latest deploy [path]
Project path
[path]

The path to the project. Defaults to the current directory.

Options

Config file
--config | -c

The name of the config file found at the project path. Defaults to trigger.config.ts

Project ref
--project-ref | -p

The project ref. Required if there is no config file.

Env file
--env-file

Load environment variables from a file. This will only hydrate the process.env of the CLI process, not the tasks.

Skip update check
--skip-update-check

Skip checking for @trigger.dev package updates.

Environment
--env | -e

Defaults to prod but you can specify staging.

Dry run
--dry-run

Create a deployable build but don’t deploy it. Prints out the build path so you can inspect it.

Build platform
--build-platform

The platform to build the deployment image for. Defaults to linux/amd64.

Skip syncing env vars
--skip-sync-env-vars

Turn off syncing environment variables with the Trigger.dev instance.

Common options

These options are available on most commands.

Login profile
--profile

The login profile to use. Defaults to “default”.

API URL
--api-url | -a

Override the default API URL. If not specified, it uses https://api.trigger.dev. This can also be set via the TRIGGER_API_URL environment variable.

Log level
--log-level | -l

The CLI log level to use. Options are debug, info, log, warn, error, and none. This does not affect the log level of your trigger.dev tasks. Defaults to log.

Skip telemetry
--skip-telemetry

Opt-out of sending telemetry data. This can also be done via the TRIGGER_TELEMETRY_DISABLED environment variable. Just set it to anything other than an empty string.

Help
--help | -h

Shows the help information for the command.

Version
--version | -v

Displays the version number of the CLI.

Self-hosting

These options are typically used when self-hosting or for local development.

Self-hosted (builds locally)
--self-hosted

Builds and loads the image using your local docker. Use the --registry option to specify the registry to push the image to when using --self-hosted, or just use --push to push to the default registry.

Skip deploying the image
--skip-deploy | -D

Load the built image into your local docker.

Load image
--load-image

Loads the image into your local docker after building it.

Registry
--registry

Specify the registry to push the image to when using --self-hosted. Will automatically enable --push.

Push image
--push

When using the --self-hosted flag, push the image to the registry.

Namespace
--namepsace

The namespace to use when pushing the image to the registry. For example, if pushing to Docker Hub, the namespace is your Docker Hub username.

Network
--network

The networking mode for RUN instructions when using --self-hosted.

Examples

Push to Docker Hub (self-hosted)

An example of deploying to Docker Hub when using a self-hosted setup:

npx trigger.dev@latest deploy \
  --self-hosted \
  --load-image \
  --registry docker.io \
  --namespace mydockerhubusername