Skip to content

Add CloudNative-PG image and path-filter image builds - #2

Merged
RobertoMachorro merged 2 commits into
mainfrom
cnpg-image
Oct 3, 2026
Merged

RobertoMachorro merged 2 commits into
mainfrom
cnpg-image

Conversation

@RobertoMachorro

Copy link
Copy Markdown
Owner

Summary

  • Adds Dockerfile.cnpg: CloudNative-PG 18.6-standard-trixie base with postgresql-18-pgtap. It is published to the same ghcr.io/robertomachorro/postgres-pgtap package with a -cnpg suffix on every tag (latest-cnpg, <sha>-cnpg, vX.Y.Z-cnpg, …).
  • Moves the build/push/sign steps into a shared workflow, .github/workflows/build-image.yml. Each image passes its own Dockerfile, tag suffix and build-cache scope, so the two images don't overwrite each other's cache.
  • docker-publish.yml now runs only when Dockerfile changes. The new docker-publish-cnpg.yml runs only when Dockerfile.cnpg changes.
  • Removes the nightly cron and adds workflow_dispatch so either image can be rebuilt by hand.
  • README: adds a table of both images and an example CNPG Cluster.

Notes

  • Pushing a v*.*.* tag still builds both images, because GitHub doesn't apply path filters to tag pushes.
  • Editing a workflow file doesn't start a build; use "Run workflow" after changing one.
  • With the cron gone, neither image picks up upstream base-image patches unless rebuilt manually.

Test plan

  • This PR touches Dockerfile.cnpg, so "Docker (CNPG)" should run (build only, no push) and the standard "Docker" workflow should not
  • After merge, latest-cnpg and <sha>-cnpg appear on the GHCR package and latest is unchanged
  • "Run workflow" button appears for both workflows

🤖 Generated with Claude Code

- Add Dockerfile.cnpg (CNPG base + postgresql-18-pgtap), published to the
  same GHCR package with a -cnpg tag suffix.
- Extract build/push/sign steps into reusable build-image.yml, with a
  per-image Dockerfile, tag suffix and GHA cache scope.
- docker-publish.yml now builds only when Dockerfile changes;
  docker-publish-cnpg.yml builds only when Dockerfile.cnpg changes.
- Replace nightly cron with workflow_dispatch.
- Document both images and CNPG usage in README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 13:31
@RobertoMachorro RobertoMachorro self-assigned this Oct 3, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Release builds can overwrite the standard image’s latest tag, and the documented CNPG deployment fails version validation.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Adds a CloudNative-PG variant alongside the existing PostgreSQL/pgTAP image, sharing the publishing pipeline.

Changes:

  • Adds the CNPG image and deployment example.
  • Shares build, push, and signing steps with separate cache scopes.
  • Replaces nightly builds with Dockerfile-filtered, release-tag, and manual builds.
File Description
README.md Documents image variants and CNPG deployment.
Dockerfile.cnpg Adds pgTAP to the CNPG base image.
.github/​workflows/​docker-publish.yml Delegates standard builds with path filtering.
.github/​workflows/​docker-publish-cnpg.yml Adds CNPG builds with suffixed tags.
.github/​workflows/​build-image.yml Centralizes building, publishing, caching, and signing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/build-image.yml Resolved
Comment thread README.md Resolved
- Set onlatest=true so the latest tag that metadata-action adds on
  v*.*.* tag pushes gets the -cnpg suffix, instead of the CNPG build
  overwriting the standard image's latest.
- CNPG can't derive the major version from a latest-cnpg tag; use an
  ImageCatalog with major: 18 in the README example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RobertoMachorro
RobertoMachorro merged commit 01294a6 into main Oct 3, 2026
1 check passed
@RobertoMachorro
RobertoMachorro deleted the cnpg-image branch October 3, 2026 14: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