New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildx: cache binary to hosted tool cache and GHA cache backend #129
Conversation
be4c881
to
639229c
Compare
1e227a2
to
6915a77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like this approach! i tested it and it works for me - https://github.com/docker/gondolier/actions/runs/5476236490/jobs/9973479123?pr=381
i'm still having problems getting buildx to build from a tag though, see this failure: https://github.com/docker/gondolier/actions/runs/5476109857/jobs/9973172585?pr=381. The only way i was able to get it to work was to manually resolve the tag to a SHA.
I need to take a closer look at this one. Have you tried with |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
6915a77
to
c1edd0b
Compare
oh forgot to mention - i confirmed that |
When installing buildx, downloaded binary is not cached. As public GitHub runners are ephemeral, this can take some time to download the binary for each workflow execution: https://github.com/docker/setup-buildx-action/actions/runs/5462992694/jobs/9943119048#step:3:1
And even more if building from source: https://github.com/docker/setup-buildx-action/actions/runs/5462992694/jobs/9943110665#step:3:1
With these changes, binary will be cached to the hosted tool cache like the official actions do today with node, go, ...
This is fine for self-hosted runners but not public runners as hosted tool cache is pruned when a job is completed. To solve this issue, we also cache the binary to the GitHub Actions Cache backend.