GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing trigger.dev — CI / GitHub Actions - Trigger.dev For GitHub Actions without stored credentials, use Trusted publishing with OIDC. The API-key instructions below also apply to other CI systems. Use an environment API key rather than a Personal Access Token so deployments are not tied to an individual team member’s account or permissions. A Personal Access Token also expires after the lifetime chosen when it was created, and a copied CLI login expires after 7 days without use.
Check out our new GitHub integration for automatic deployments, without adding any GitHub Actions workflows. GitHub Actions exampleThis simple GitHub action workflow will deploy your Trigger.dev tasks when new code is pushed to themain branch.
The deploy step will fail if any version mismatches are detected. Please see the version
pinning section for more details. Pinning runs to the deployment you just builtThe--external-id ${{ github.sha }} above tags the deployment with the commit it was built from. That is the first half of version skew protection: to complete it, give your running application the same value so it sends that id when it triggers.
Tagging the deployment is harmless on its own: if nothing sends a matching id, runs behave exactly
as they do today. --external-id also makes repeat deploys idempotent — re-running the workflow
for a commit that is already deployed reports the existing version instead of building again.Two things follow from that. Because no build runs, a re-run after changing a synced environment
variable won’t pick the new value up — make an empty commit, or pass --force. And if you add a
paths: filter to this workflow, ${{ github.sha }} stops being a safe id: commits that don’t
touch your tasks never produce a deployment carrying that SHA, so every run from those releases
expires. See when nothing ever
lands.Preview branchesTo deploy to preview branches from Pull Requests and have them archived when PRs are merged or closed, use a workflow that runs onpull_request with all four types including closed:
.github/workflows/trigger-preview-branches.yml pull_request, github.sha is the merge commit GitHub creates for the PR, not the commit your
app was built from. Use github.event.pull_request.head.sha so the id matches the one your preview
deployment sends.
Include closed in the pull_request.types list. Without it, preview branches won’t be archived when PRs are merged or closed, and you may hit the limit on active preview branches. See Preview branches for more details.Create a deployment API keyCreate a separate API key for each environment that your CI workflows deploy to. The key remains valid when team membership or permissions change.1 Open the API keys page Select the project and target environment, then open API keys. 2 Create an API key Click New API key, give the key a name that identifies the workflow, and choose Deploy
only access. 3 Copy the API key Create the key and copy its value. Trigger.dev shows the complete value only once. 4 Add the TRIGGER_ACCESS_TOKEN secret to GitHub Open the repository’s Settings, then select Secrets and variables → Actions → New
repository secret. Add the name TRIGGER_ACCESS_TOKEN and paste the API key as its value.![]() TRIGGER_ACCESS_TOKEN in each workflow.
CLI Version pinningThe 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 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:
package.json script, like so:
.github/workflows/release-trigger.yml --version to any command.
Self-hostingWhen self-hosting, you need to:
Was this page helpful? ⌘I |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |