Repository navigation
build-push-ecr: layer cache in the Actions cache and ECR on hosted runners - #83
Closed
hamishfagg wants to merge 1 commit into
Closed
hamishfagg wants to merge 1 commit into
hamishfagg wants to merge 1 commit into
Conversation
…unners The gha cache flags were dropped from a `run:` step because buildx had no ACTIONS_RUNTIME_TOKEN there. A github-script step now copies the runner's ACTIONS_* variables into the job environment, and a hosted build imports from and exports to both the Actions cache (scope <module-name>) and <image>:buildcache in ECR, mode=max. The remote-builder path keeps its local cache and passes no cache flags. Inputs reach the script through env rather than inline expressions, and the github-env-vars action is gone: the only value it supplied was the sha, which github.sha already holds. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
Superseded by a new build-image action built on docker/build-push-action; this one stays as it is until its last caller moves. |
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.
On a GitHub-hosted runner
docker buildx buildruns from arun:step, which has noACTIONS_RUNTIME_TOKEN, so buildx silently skipped thetype=ghacache flags and every build started cold. This PR:github-scriptstep (hosted path only) that copies the runner'sACTIONS_*variables into the job environment, which is what theghabackend reads;--cache-from/--cache-tofor two caches per image: the Actions cache withscope=<module-name>, and<image>:buildcachein ECR, bothmode=max;FranzDiebold/github-env-vars-actionfrom this action (its only used value wasCI_SHA, whichgithub.shaholds) and moves the inputs into the step'senv.Call sites are unchanged.
extra-build-argsis still split on whitespace and expanded on the build line.Tested on mindsdb/scratchpad-controller#144, whose build job checks out this branch:
CACHED. The browser build gets no hits because its--no-cache-filter baseinvalidates every later stage.🤖 Generated with Claude Code