Skip to content

CI: Add image caching to when we update the CI image.#75

Merged
derobins merged 4 commits into
developfrom
rildixon/ci-re-add-image-caching
Nov 21, 2025
Merged

CI: Add image caching to when we update the CI image.#75
derobins merged 4 commits into
developfrom
rildixon/ci-re-add-image-caching

Conversation

@riley-dixon
Copy link
Copy Markdown
Collaborator

Re-introduce caching when building & updating the latest CI image. This will help reduce how quickly the local docker image registry fills up with dangling image layers.

A future enhancement could be adding another --cache-from instruction that caches from the PR that was just merged. If the Dockerfile was changed, it can re-use the image layers from the pre-checkin workflow runs. Else, there is a cache-miss but otherwise does not stop the build from taking place.

Also fixes an issue with the gate when triggering this workflow manually. Before this change, the workflow could be manually triggered but would immediately be "skipped" due to failing the if: condition on the job.

Workflow run after PR merge that invalidates the cache (e.g. modify DOCKERFILE): https://github.com/riley-dixon/hipFile-test/actions/runs/19553569023
Workflow run after PR merge without invalidating the cache: https://github.com/riley-dixon/hipFile-test/actions/runs/19553743491
Manual run with caching from enabled: https://github.com/riley-dixon/hipFile-test/actions/runs/19553782405
Manual run with caching from disabled: https://github.com/riley-dixon/hipFile-test/actions/runs/19553796414

@riley-dixon riley-dixon marked this pull request as ready for review November 20, 2025 23:47
On pull_requests, if the Dockerfile has been modified, a new image will be
build and pushed using as many cached layers as possible.
Otherwise, this effectively is a no-op as the entire image is already
cached.

If this is triggered manually via workflow_dispatch, this gives the option
of not consuming the cache to forcibly update the image packages.
Regardless of this option, the resulting image is cached for future use.
This gate missed a condition to allow a workflow_dispatch job
to execute.
Dev CI image (i.e. unmerged PR's that have changed a DOCKERFILE) will
now try to use caching from the latest image. This will further reduce
how quickly the local docker image registry grows with new images
from CI.
@riley-dixon riley-dixon force-pushed the rildixon/ci-re-add-image-caching branch from 0b00237 to eea5be1 Compare November 20, 2025 23:48
@derobins derobins merged commit 072bd74 into develop Nov 21, 2025
32 checks passed
@derobins derobins deleted the rildixon/ci-re-add-image-caching branch November 21, 2025 00:58
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.

3 participants