OUT-4184: auto-deploy to Trigger.dev on merge to main - #154
Merged
Merged
Conversation
Add a self-contained deploy workflow that runs on push to main: lint, typecheck, unit, and integration jobs gate a deploy job (needs all four) that runs `pnpm trigger:deploy` with VERCEL_ENV=production so Sentry sourcemaps upload. Secrets come from the Production GitHub Environment. - add trigger:deploy script mirroring trigger:dev - concurrency group; newest push to main supersedes an in-flight run - pin all actions to full commit SHAs across the three workflows - run code-quality and test on pull_request only (merges to main are now checked by deploy.yml), removing duplicate push+PR runs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Greptile P1: workflow-level cancel-in-progress could cancel an in-flight deploy when a newer push arrived; if that push then failed a check, neither commit deployed. Move concurrency to the deploy job with cancel-in-progress: false so deploys serialize and a running publish is never interrupted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai review |
With serial (non-cancelable) deploys, a slower older run could publish after a newer one and leave production on stale code. Guard the deploy step: if this run's commit is no longer the branch tip, skip it so only the newest commit publishes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai review again |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds a self-contained GitHub Actions workflow (
.github/workflows/deploy.yml) that auto-deploys to Trigger.dev's production environment on every merge tomain, gated behind the existing Tests + Code Quality checks.Part of OUT-4184 (applies the QuickBooks pattern to the Dropbox integration).
How it works
On push to
main, four check jobs run —lint(pnpm lint),typecheck(pnpm typecheck),unit-tests(pnpm test),integration-tests(pnpm test:integration) — anddeploy(needs: [all four]) runspnpm trigger:deployonly if all pass. The check jobs mirrorcode-quality.yml/test.yml(pnpm 10.15, Node 22, same setup), so the deploy gate is self-contained.Sentry sourcemaps
The deploy job sets
VERCEL_ENV=production, which flips theisProdbranch intrigger.config.tsand uploads Sentry sourcemaps for readable production stack traces. It passesSENTRY_ORG,SENTRY_PROJECT,SENTRY_AUTH_TOKEN,NEXT_PUBLIC_SENTRY_DSN, plusTRIGGER_ACCESS_TOKENandTRIGGER_PROJECT_ID.The repo's
ProductionGitHub Environment exists but is empty. Add all six secrets (TRIGGER_ACCESS_TOKEN,TRIGGER_PROJECT_ID,SENTRY_ORG,SENTRY_PROJECT,SENTRY_AUTH_TOKEN,NEXT_PUBLIC_SENTRY_DSN) or the deploy will fail fast (they arez.parsed intrigger.config.ts). Thedeployjob declaresenvironment: Productionso it can read them.Also in this PR
code-quality.yml/test.yml: trigger changed topull_requestonly (waspush+pull_request). This removes the duplicate push+PR runs on PR branches; merges tomainare now checked bydeploy.yml. Tradeoff: a branch with commits but no open PR no longer gets checks until a PR is opened.package.json: addedtrigger:deployscript mirroringtrigger:dev.Not covered
main, that path is separate and unaffected.🤖 Generated with Claude Code