Files
metabuilder/.github
johndoe6345789 57be5dbc42 perf(ci): smart rebuild detection for app images using git diff + watch_paths
Each matrix entry now declares watch_paths (source dirs that affect the
image). The check step combines GHCR existence with git diff:

  image exists in GHCR + no changes in watch_paths → docker pull (fast)
  image missing OR watch_paths changed              → full rebuild + push

Uses git fetch --depth=1 origin $BEFORE to get the pre-push commit for
diffing without fetching full history. Handles edge cases: new branch,
first push (zero SHA), and manual workflow_dispatch all trigger rebuild.

watch_paths per image:
  nextjs-app, codegen, pastebin, emailclient, workflowui: frontend dir + packages + components
  postgres-dashboard: frontends/postgres + packages
  exploded-diagrams:  frontends/exploded-diagrams
  dbal:               dbal/
  dbal-init:          deployment/config/dbal + dbal/shared

TODO: expose rebuild=true/false per image to Gate 2 so E2E tests can
skip unchanged apps and reuse cached playwright-report artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 22:35:42 +00:00
..