Deploy your tasks
Run the deploy command using your package manager:Log in to the CLI
If you haven’t already, authenticate the CLI with your Trigger.dev account:This opens a browser window where you can log in and link your CLI.
Deploying consists of building your tasks and uploading them to Trigger.dev. This process can take
a few seconds to a few minutes depending on the size of your project and whether you are using
remote or local builds.
Environments
Trigger.dev supports multiple isolated environments. Each environment has its own API keys, versions, and run history.| Environment | CLI flag | API key prefix | Description |
|---|---|---|---|
prod | (default) | tr_prod_ | Production environment |
staging | --env staging | tr_stg_ | Staging environment for pre-production testing |
| Preview | — | — | Ephemeral per-branch environments for testing and development |
dev | — | tr_dev_ | Local development via trigger.dev dev |
Deploying to staging
Staging deploys are only available on Hobby and Pro plans on Trigger.dev Cloud.
Preview environments
For teams that want a separate environment per branch, preview branches create fully isolated environments automatically from your CI pipeline. Configure them in your CI/CD workflow to deploy each branch to its own environment.Versions
Every deployment creates a new version of all tasks in the project. A version is an immutable snapshot of your task code at a point in time. Version identifiers look like20250228.1 — the date followed by a sequence number that increments for each deploy on that date within that environment.
Current version
When you deploy, the new version is automatically promoted to become the current version for that environment. All new task runs are dispatched against the current version.A single environment can only have one current version at a time.
Version locking
Once a task run starts, it is locked to the version that was current at start time. Retries of that run also execute against the same locked version. This means deploying new code never interrupts runs that are already in progress. Child tasks triggered withtriggerAndWait or batchTriggerAndWait inherit the parent’s version lock. Fire-and-forget triggers (trigger, batchTrigger) use the current version.
| Trigger function | Child task version | Locked |
|---|---|---|
trigger() | Current | No |
batchTrigger() | Current | No |
triggerAndWait() | Parent version | Yes |
batchTriggerAndWait() | Parent version | Yes |
Skipping promotion
Deploy a new version without immediately making it the current version using--skip-promotion:
Local builds
By default, Trigger.dev uses a remote build provider to speed up deployments. You can force a local build if needed:Environment variables
Set environment variables for your deployed tasks in the Trigger.dev dashboard under Project > Environment Variables, or sync them automatically using thesyncEnvVars, syncVercelEnvVars, or syncSupabaseEnvVars build extensions from @trigger.dev/build. See Build extensions for details.
CI/CD with GitHub Actions
You can automate deployments from GitHub Actions by running the deploy command with aTRIGGER_ACCESS_TOKEN environment variable set to a personal access token.
.github/workflows/deploy.yml
trigger.config.ts is not at the repository root, pass the config path explicitly:
Troubleshooting
Dry runs
Inspect what will be built and uploaded without actually deploying:Debug logs
For verbose output, append--log-level debug to the deploy command. Do not share debug logs publicly — they may contain private information about your project.
Common errors
Failed to build project image: Error building image
Check the build logs linked in the error output. If the error is caused by a remote build provider outage, retry with --force-local-build.
No loader is configured for ".node" files
Native packages cannot be bundled. Add the package to build.external in your trigger.config.ts:
trigger.config.ts
Deployment encountered an error
Check the guidance printed below the error message. If you can’t resolve it, open a Help forum post in the Trigger.dev Discord with a link to your deployment.