Skip to content

ci: skip production jobs on non-release PRs and pushes to main#33

Open
frrist wants to merge 1 commit intomainfrom
frrist/fix/prod-ci-jobs
Open

ci: skip production jobs on non-release PRs and pushes to main#33
frrist wants to merge 1 commit intomainfrom
frrist/fix/prod-ci-jobs

Conversation

@frrist
Copy link
Member

@frrist frrist commented Mar 11, 2026

Summary

This PR modifies the deploy workflow to skip production jobs on regular PRs and pushes to main. Production CI now runs only when actually relevant: during releases, manual triggers, or release PR validation.

Problem

The previous workflow ran production jobs—including Docker image pushes to production ECR and terraform plans—on every push to main and every PR. This behavior was:

  • Wasteful: Building production images that would never deploy
  • Confusing: Production CI jobs appearing on routine PRs and merges
  • Non-standard: Most CI pipelines reserve production jobs for actual releases

Solution

Added a check-release-pr job that detects whether a PR modifies version.json (the marker for release PRs). Production jobs now include conditions that skip execution unless one of the following is true:

  • The trigger is a workflow_run event (Releaser workflow completed)
  • The trigger is a workflow_dispatch event (manual)
  • The PR changes version.json (release validation)

Behavior Matrix

Event Staging Jobs Production Jobs
Push to main Run + Apply Skipped
PR (regular) Run + Plan Skipped
PR (version.json changed) Run + Plan Run + Plan
Releaser completes Run + Apply Run + Apply
Manual dispatch Per selection Per selection

Add check-release-pr job to detect PRs that modify version.json.
  Production jobs now only run when:
  - Releaser workflow completes (workflow_run)
  - Manual trigger (workflow_dispatch)
  - Release PR validation (version.json changed)

This eliminates wasteful production image builds and terraform plans on regular PRs and pushes to main, aligning with standard CI practices.
Most importantly, this prevents developers from being confused when merging PRs.

closes #32
@frrist frrist requested a review from volmedo March 11, 2026 20:49
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.

1 participant