Skip to content

ci: trigger CD (Production) on release publish#700

Merged
jirhiker merged 3 commits into
stagingfrom
ci/cd-production-on-release-published
Jun 8, 2026
Merged

ci: trigger CD (Production) on release publish#700
jirhiker merged 3 commits into
stagingfrom
ci/cd-production-on-release-published

Conversation

@jirhiker

@jirhiker jirhiker commented Jun 8, 2026

Copy link
Copy Markdown
Member

Why

  • Previously CD (Production) ran on every push of a v*.*.* tag. Tags can land before a release is cut (or via dependabot/manual pushes), which deployed prematurely.
  • Want production deploys gated on an actual GitHub Release being published — matches release-please flow.

How

  • Trigger changed: push.tagsrelease: types: [published].
  • Checkout step pinned to ref: \${{ github.event.release.tag_name }} so the deploy uses the tagged commit (on release events, github.ref points to the default branch, not the tag).
  • APP_VERSION env switched from github.ref_namegithub.event.release.tag_name.

Notes

  • release-please workflow already publishes a release when its PR merges to production / hotfix/v*, so the new trigger fires there.
  • No change to deploy steps, secrets, or environment.

Switch the workflow trigger from push of v*.*.* tags to the GitHub
release `published` event so production only deploys when a release
is actually cut (e.g. via release-please), not on every matching tag
push. Check out the release tag explicitly and use
github.event.release.tag_name for APP_VERSION since github.ref on a
release event points to the default branch, not the tag.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 17:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the production CD workflow to deploy only when a GitHub Release is published (instead of on any matching tag push), aligning production deploys with the repository’s release-publishing flow.

Changes:

  • Switch workflow trigger from push.tags to release: types: [published].
  • Ensure the deploy checks out the release’s tag and uses it as APP_VERSION.

Comment thread .github/workflows/CD_production.yml
Comment thread .github/workflows/CD_production.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c394ca556f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/CD_production.yml
jirhiker and others added 2 commits June 8, 2026 11:06
Preserve the safety rail the previous push.tags trigger provided.
A release.published event will fire for any tag, so add:
- job-level if: startsWith(tag, 'v') as a cheap pre-filter
- first-step bash regex (^v[0-9]+\.[0-9]+\.[0-9]+(-.+|[a-z].*)?$) that
  fails the run on a mismatch

Matches the original v*.*.*, v*.*.*-*, v*.*.*[a-z]* patterns so an
ad-hoc release on a non-version tag no longer deploys to production.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
actions/checkout's ref accepts ambiguous short names. If a branch
were ever created with the same name as a release tag, the deploy
would check out the branch instead of the tagged commit. Use the
fully-qualified refs/tags/<tag> form to remove the ambiguity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jirhiker jirhiker merged commit e063ed2 into staging Jun 8, 2026
9 of 10 checks passed
@jirhiker jirhiker deleted the ci/cd-production-on-release-published branch June 8, 2026 17:11
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