Skip to content

OUT-4184: auto-deploy to Trigger.dev on merge to master - #288

Merged
SandipBajracharya merged 2 commits into
masterfrom
OUT-4184
Sep 15, 2026
Merged

SandipBajracharya merged 2 commits into
masterfrom
OUT-4184

Conversation

@SandipBajracharya

Copy link
Copy Markdown
Collaborator

What

Adds a self-contained GitHub Actions workflow (.github/workflows/deploy.yml) that auto-deploys to Trigger.dev's production environment on every merge to master, gated behind the existing Tests + Code Quality checks.

Closes OUT-4184 (QuickBooks repo only — see follow-ups).

How it works

On push to master, four jobs run:

  • typecheck → yarn typecheck:test
  • test → yarn test
  • lint → yarn lint:check && yarn prettier:check
  • deploy → needs: [typecheck, test, lint], runs yarn trigger:deploy

The three check jobs run in parallel; deploy only starts if all three pass. They mirror the existing test.yml / lint.yml so the deploy gate is fully self-contained (no cross-workflow status coupling — easier to copy to the other integration repos).

Sentry sourcemaps

The deploy job sets VERCEL_ENV=production, which flips the isProd branch in trigger.config.ts and uploads Sentry sourcemaps so production stack traces are readable. It passes SENTRY_ORG, SENTRY_PROJECT, SENTRY_AUTH_TOKEN, NEXT_PUBLIC_SENTRY_DSN, plus TRIGGER_ACCESS_TOKEN and TRIGGER_PROJECT_ID.

Secrets

All six secrets already exist in the repo's Production GitHub Environment (scoped to master), which is why the deploy job declares environment: Production — environment-scoped secrets are only exposed to a job that names the environment.

Hardening / robustness

  • concurrency: deploy-production with cancel-in-progress: false — queues deploys and preserves commit order.
  • yarn install --immutable in all jobs — deployed deps provably match the lockfile.
  • permissions: contents: read at workflow root.
  • timeout-minutes: 20 on the deploy job.
  • Fixed SENTRY_AUTHTOKEN → SENTRY_AUTH_TOKEN typo in .env.example.

Follow-ups (not in this PR)

  • Apply the same workflow to the Xero and Dropbox integration repos, each with its own Production environment + secrets (distinct TRIGGER_PROJECT_ID).

🤖 Generated with Claude Code

Add a self-contained deploy workflow that runs on push to master:
typecheck, test, and lint gate a deploy job (needs all three) that
runs `yarn trigger:deploy` with VERCEL_ENV=production so Sentry
sourcemaps upload. Secrets come from the Production GitHub Environment.

- concurrency group preserves commit order, never cancels in-flight
- yarn install --immutable pins the deployed deps to the lockfile
- permissions: contents:read and a deploy timeout for hardening
- fix SENTRY_AUTHTOKEN typo in .env.example

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
quickbooks-sync Building Building Sep 15, 2026 6:51am UTC
quickbooks-sync (dev) Ready Ready Preview Sep 15, 2026 6:51am UTC

Request Review

@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown

OUT-4184

@greptile-apps

greptile-apps Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Findings

  1. P2 deploy-production does not create a first-in, first-out queue. GitHub keeps only one pending run for a concurrency group and may replace it when another push arrives. With three quick merges, the middle workflow can be canceled before deploy , so this does not deploy every merge in commit order. Use a queue that records each commit, or state clearly that only the newest pending commit will deploy. ▶

Summary

Merges to master now run checks and deploy the Trigger.dev project to production when all checks pass. The workflow also supplies production Sentry settings and pins GitHub Actions to fixed commits.

  • Runs type checks, tests, and linting in parallel before deployment.
  • Deploys with production Trigger.dev and Sentry environment values.
  • Uses immutable installs, deployment limits, and fixed action commits.
  • Renames the example Sentry token to match the code.

Diagram

sequenceDiagram
    participant Git as Push to master
    participant Actions as GitHub Actions
    participant Checks as Typecheck, test, lint
    participant Trigger as Trigger.dev production
    Git->>Actions: Start workflow for commit
    Actions->>Checks: Run three checks in parallel
    alt A check fails
        Checks-->>Actions: Failure
        Actions--xTrigger: Skip deploy
    else All checks pass
        Checks-->>Actions: Success
        Actions->>Trigger: Run yarn trigger:deploy
    end
    opt Newer push arrives before completion
        Git->>Actions: Start newer workflow
        Actions--xActions: Cancel older workflow
    end
Loading

Reviews (2) · Last reviewed commit: "fix(OUT-4184): address Greptile review o..."

Comment thread .github/workflows/deploy.yml Outdated
Comment on lines +8 to +10
concurrency:
group: deploy-production
cancel-in-progress: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 deploy-production does not create a first-in, first-out queue. GitHub keeps only one pending run for a concurrency group and may replace it when another push arrives. With three quick merges, the middle workflow can be canceled before deploy, so this does not deploy every merge in commit order. Use a queue that records each commit, or state clearly that only the newest pending commit will deploy.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to cancel-in-progress: true. Only the newest commit on master should deploy — an older in-flight run is superseded, and since master is linear the newer commit already contains the older one. A per-commit FIFO queue isn't a goal here.

Comment thread .github/workflows/deploy.yml Outdated
- cancel-in-progress: true so newest master supersedes an in-flight run
- pin actions/checkout and actions/setup-node to full commit SHAs across
  deploy.yml, test.yml, and lint.yml (mutable tags can be moved after a
  compromise); deploy job handles production secrets

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SandipBajracharya

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@SandipBajracharya SandipBajracharya changed the title feat(OUT-4184): auto-deploy to Trigger.dev on merge to master OUT-4184: auto-deploy to Trigger.dev on merge to master Sep 15, 2026

@priosshrsth priosshrsth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SandipBajracharya
SandipBajracharya merged commit 425816d into master Sep 15, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
dev — 38a7aab6 Deployed Sep 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants