-
-
Notifications
You must be signed in to change notification settings - Fork 842
chore(docs): improve version pinning advise to use installed trigger.dev CLI #2466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,13 +102,16 @@ If you already have a GitHub action file, you can just add the final step "🚀 | |
## CLI Version pinning | ||
|
||
The CLI and `@trigger.dev/*` package versions need to be in sync with the `trigger.dev` CLI, otherwise there will be errors and unpredictable behavior. Hence, the `deploy` command will automatically fail during CI on any version mismatches. | ||
Tip: add the deploy command to your `package.json` file to keep versions managed in the same place. For example: | ||
Tip: add the `trigger.dev` CLI to your `devDependencies` and the deploy command to your `package.json` file to keep versions managed in the same place. For example: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"deploy:trigger-prod": "npx trigger.dev@3.0.0 deploy", | ||
"deploy:trigger": "npx trigger.dev@3.0.0 deploy --env staging" | ||
"deploy:trigger-prod": "trigger deploy", | ||
"deploy:trigger": "trigger deploy --env staging" | ||
}, | ||
"devDependencies": { | ||
"trigger.dev": "4.0.2" | ||
} | ||
} | ||
``` | ||
|
@@ -134,9 +137,7 @@ When self-hosting, you will have to take a few additional steps: | |
- 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> | ||
<Tip>If you're self-hosting v4, the `--self-hosted` and `--push` flags are **NOT** needed.</Tip> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Contradiction: Tip says flags NOT needed on v4, but example still uses them. Self-hosted v4 should not pass --self-hosted/--push per the Tip. Align the example and also use the local CLI via script. - 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
+ # deploy using the pinned local CLI (no extra flags on v4)
+ run: |
+ npm run deploy:trigger Also applies to: 182-190 🤖 Prompt for AI Agents
|
||
|
||
Other than that, your GitHub action file will look very similar to the one above: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Also pin your
@trigger.dev/*
packages to the same version as the CLI.The deploy step will fail if app packages and CLI differ. Expand the example to make this explicit.
Optionally add install commands right below the snippet:
npm i -D trigger.dev@4.0.2 && npm i @trigger.dev/sdk@4.0.2
🤖 Prompt for AI Agents