ci(relay2): only deploy relay2 when relay2-relevant paths change

Closed
SA
4mo ago
+20-0

Summary

Every relay2 deploy restarts its Durable Objects, which severs every live host tunnel (hosts reconnect in ~2s, but in-flight streams drop). deploy-production.yml runs on every push to main with no path gating, so today's six unrelated merges bounced the entire relay2 fleet six times in one hour.

This gates the deploy-relay2 job with dorny/paths-filter (pinned v3.0.2): it now deploys only when apps/relay2/**, its workspace deps (packages/shared/**, packages/trpc/**), bun.lock, or the workflow itself changed. workflow_dispatch always deploys, preserving the manual escape hatch.

The stateless Cloudflare workers (electric-proxy) are left as-is — redeploying them on every push is harmless.

Test plan

  • bun run lint clean
  • After merge: verify an unrelated main push skips the Deploy Worker step, and a relay2-touching push (or manual dispatch) still deploys

Summary by CodeRabbit

  • Chores
    • Improved production deployment handling by detecting relevant changes before running deployment steps.
    • Manual deployments continue to run on demand without change filtering.
    • Added clearer deployment guidance, including information about restart behavior during updates.

Summary by cubic

Gate relay2 deployments so the job only runs when relay2-related files change, preventing unnecessary Durable Object restarts and dropped host tunnels. Uses dorny/paths-filter@v3.0.2 to watch apps/relay2/**, packages/shared/**, packages/trpc/**, bun.lock, and the workflow; workflow_dispatch still triggers a deploy.