Skip to content

Commit

Permalink
Added an image of where to set the v3 GitHub action secret
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-aitken committed May 12, 2024
1 parent 2e02743 commit 194f336
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Binary file added docs/images/v3/github-access-token.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 18 additions & 4 deletions docs/v3/github-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ description: "You can easily deploy your tasks with GitHub actions."

This simple GitHub action file will deploy you Trigger.dev tasks when new code is pushed to the `main` branch and the `trigger` directory has changes in it.

<Warning>The deploy step will fail if any version mismatches are detected. Please see the [version pinning](/v3/github-actions#version-pinning) section for more details.</Warning>
<Warning>
The deploy step will fail if any version mismatches are detected. Please see the [version
pinning](/v3/github-actions#version-pinning) section for more details.
</Warning>

<CodeGroup>

Expand All @@ -30,7 +33,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Install dependencies
run: npm install

Expand All @@ -41,7 +44,6 @@ jobs:
npx trigger.dev@beta deploy
```


```yaml .github/workflows/release-trigger-staging.yml
name: Deploy to Trigger.dev (staging)

Expand All @@ -60,7 +62,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Install dependencies
run: npm install

Expand All @@ -70,6 +72,7 @@ jobs:
run: |
npx trigger.dev@beta deploy --env staging
```

</CodeGroup>

If you already have a GitHub action file, you can just add the final step "🚀 Deploy Trigger.dev" to your existing file.
Expand All @@ -78,6 +81,17 @@ You need to add the `TRIGGER_ACCESS_TOKEN` secret to your repository. You can cr

To set it in GitHub go to your repository, click on "Settings", "Secrets and variables" and then "Actions". Add a new secret with the name `TRIGGER_ACCESS_TOKEN` and use the value of your access token.

<Accordion title="How to add TRIGGER_ACCESS_TOKEN in GitHub">
1. Go to your repository on GitHub.
2. Click on "Settings".
3. Click on "Secrets and variables" -> "Actions"
4. Click on "New repository secret".
5. Add the name `TRIGGER_ACCESS_TOKEN` and the value of your access token.

![Add TRIGGER_ACCESS_TOKEN in GitHub](/images/v3/github-access-token.png)

</Accordion>

## 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.
Expand Down

0 comments on commit 194f336

Please sign in to comment.