feat(unit): build base images on pull requests without pushing them #67

Merged
cjournois merged 1 commit from feat/improve-build-without-push into main 2026-10-16 11:32:43 +00:00
Collaborator

The base-image job pushed an image and exported :buildcache on every pull request, so a consumer like devops/image could not build on PRs without publishing PR images. A push input on docker-build-push, set to false on pull_request events, builds with --output type=cacheonly and writes nothing to the registry. Step 1 of proposal 2026-10-10-1; step 2 adds PR triggers in devops/image once this ships as 5.1.0.

  • image job (base images): push: ${{ github.event_name != 'pull_request' }}.

  • publish job unchanged: its [publish] PR-title opt-in stays a deliberate publish from a PR.

  • With PUSH=false, docker-build-push.sh runs buildx with --output type=cacheonly and no --push or --cache-to (bats); with PUSH unset the commands are byte-identical (bats, checked against the old script)

  • unit.yml's image job passes push: ${{ github.event_name != 'pull_request' }} to docker-build-push

  • Released as 5.1.0 (after merge)

Verified: just lint test passes (shellcheck, actionlint, 441 bats). Unverified: a real buildx run of the cacheonly path with -t tags; the tests stub docker, so the first devops/image PR on 5.1.0 is the live check. The action is referenced @main from unit.yml, so it ships on merge; its default keeps today's behaviour.

The base-image job pushed an image and exported `:buildcache` on every pull request, so a consumer like devops/image could not build on PRs without publishing PR images. A `push` input on docker-build-push, set to false on pull_request events, builds with `--output type=cacheonly` and writes nothing to the registry. Step 1 of proposal 2026-10-10-1; step 2 adds PR triggers in devops/image once this ships as 5.1.0. - `image` job (base images): `push: ${{ github.event_name != 'pull_request' }}`. - `publish` job unchanged: its `[publish]` PR-title opt-in stays a deliberate publish from a PR. - [x] With PUSH=false, docker-build-push.sh runs buildx with `--output type=cacheonly` and no `--push` or `--cache-to` (bats); with PUSH unset the commands are byte-identical (bats, checked against the old script) - [x] unit.yml's image job passes `push: ${{ github.event_name != 'pull_request' }}` to docker-build-push - [ ] Released as 5.1.0 (after merge) Verified: `just lint test` passes (shellcheck, actionlint, 441 bats). Unverified: a real buildx run of the cacheonly path with `-t` tags; the tests stub docker, so the first devops/image PR on 5.1.0 is the live check. The action is referenced `@main` from unit.yml, so it ships on merge; its default keeps today's behaviour.
feat(unit): build base images on pull requests without pushing them
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 29s
ci: reusable-pipeline / CI Pipeline (push) Successful in 28s
ea4a426632
docker-build-push gains a push input (default true); push=false builds with --output type=cacheonly, keeps --cache-from, and skips --push and the buildcache export (bats test).
With PUSH unset, both buildx commands are unchanged (bats test, also green on the old script).
The base-image image job sets push to github.event_name != 'pull_request'; the gated publish job keeps its opt-in [publish] PR push.
Docs and README updated; just lint test green.
cjournois deleted branch feat/improve-build-without-push 2026-10-16 11:32:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cjournois/reusable-pipeline!67
No description provided.