CI: Add image caching to when we update the CI image.#75
Merged
Conversation
jordan-turbofish
approved these changes
Nov 20, 2025
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.
0b00237 to
eea5be1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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