Skip to content

Added tip for setting up github actions using npm run to simplify version pinning #1132

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 4 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/v3/github-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,24 @@ To set it in GitHub go to your repository, click on "Settings", "Secrets and var
## Version pinning

The CLI and `@trigger.dev/*` package versions need to be in sync, otherwise there will be errors and unpredictable behavior. Hence, the `deploy` command will automatically fail during CI on any version mismatches.

To ensure a smooth CI experience you can pin the CLI version in the deploy step, like so:
Tip: add the deploy command to your `package.json` file to keep versions managed in the same place. For example:

```json
{
"scripts": {
"deploy:trigger-prod": "npx [email protected] deploy",
"deploy:trigger": "npx [email protected] deploy --env staging"
}
}
```
Your workflow file will follow the version specified in the `package.json` script, like so:

```yaml .github/workflows/release-trigger.yml
- name: 🚀 Deploy Trigger.dev
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
run: |
npx [email protected] deploy
npm run deploy:trigger
```

You should use the version you run locally during dev and manual deploy. The current version is displayed in the banner, but you can also check it by appending `--version` to any command.