docs: fix self-hosting section in deploy docs (#2836)

Fixes #2835

There were still some flags in here we removed, deploying is a lot
simpler now for self-hosters.

Also updates the github actions guide.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
nicktrn
2026-01-06 20:20:20 +00:00
committed by GitHub
parent 752ad32293
commit 47bed15255
2 changed files with 12 additions and 57 deletions
+4 -13
View File
@@ -134,16 +134,11 @@ You should use the version you run locally during dev and manual deploy. The cur
## Self-hosting
When self-hosting, you will have to take a few additional steps:
When self-hosting, you need to:
- Specify the `TRIGGER_API_URL` environment variable. You can add it to the GitHub secrets the same way as the access token. This should point at your webapp domain, for example: `https://trigger.example.com`
- Setup docker as you will need to build and push the image to your registry. On [Trigger.dev Cloud](https://cloud.trigger.dev) this is all done remotely.
- Set up Docker Buildx in your CI environment for building images locally.
- Add your registry credentials to the GitHub secrets.
- Use the `--self-hosted` and `--push` flags when deploying.
<Tip>If you're self-hosting v4, the `--self-hosted` and `--push` flags are **NOT** needed.</Tip>
Other than that, your GitHub action file will look very similar to the one above:
- Specify the `TRIGGER_API_URL` environment variable pointing to your webapp domain, for example: `https://trigger.example.com`
<CodeGroup>
@@ -170,13 +165,11 @@ jobs:
- name: Install dependencies
run: npm install
# docker setup - part 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
# docker setup - part 2
- name: Login to DockerHub
uses: docker/login-action@v3
with:
@@ -186,11 +179,9 @@ jobs:
- name: 🚀 Deploy Trigger.dev
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
# required when self-hosting
TRIGGER_API_URL: ${{ secrets.TRIGGER_API_URL }}
# deploy with additional flags
run: |
npx trigger.dev@latest deploy --self-hosted --push
npx trigger.dev@latest deploy
```
</CodeGroup>
+8 -44
View File
@@ -77,6 +77,10 @@ npx trigger.dev@latest deploy [path]
Turn off syncing environment variables with the Trigger.dev instance.
</ParamField>
<ParamField body="Local build" type="--local-build">
Force building the deployment image locally using your local Docker. This is automatic when self-hosting.
</ParamField>
### Common options
These options are available on most commands.
@@ -85,50 +89,10 @@ These options are available on most commands.
### Self-hosting
These options are typically used when [self-hosting](/open-source-self-hosting) or for local development.
<ParamField body="Self-hosted (builds locally)" type="--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.
</ParamField>
<ParamField body="Skip deploying the image" type="--skip-deploy | -D">
Load the built image into your local docker.
</ParamField>
<ParamField body="Load image" type="--load-image">
Loads the image into your local docker after building it.
</ParamField>
<ParamField body="Registry" type="--registry">
Specify the registry to push the image to when using `--self-hosted`. Will automatically enable
`--push`.
</ParamField>
<ParamField body="Push image" type="--push">
When using the `--self-hosted` flag, push the image to the registry.
</ParamField>
<ParamField body="Namespace" type="--namespace">
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.
</ParamField>
<ParamField body="Network" type="--network">
The networking mode for RUN instructions when using `--self-hosted`.
</ParamField>
## Examples
### Push to Docker Hub (self-hosted)
An example of deploying to Docker Hub when using a self-hosted setup:
When [self-hosting](/self-hosting/overview), builds are performed locally by default. Once you've logged in to your self-hosted instance using the CLI, you can deploy with:
```bash
npx trigger.dev@latest deploy \
--self-hosted \
--load-image \
--registry docker.io \
--namespace mydockerhubusername
npx trigger.dev@latest deploy
```
For CI/CD environments, set `TRIGGER_ACCESS_TOKEN` and `TRIGGER_API_URL` environment variables. See the [GitHub Actions guide](/github-actions#self-hosting) for more details.