WeblateOrg / docker

Official Docker container for Weblate, a libre software web-based continuous localization system
https://docs.weblate.org/en/latest/admin/install/docker.html
GNU General Public License v3.0
92 stars 107 forks source link

Avoid invoking build multiple times in CI pipeline #2589

Open nijel opened 2 months ago

nijel commented 2 months ago

Describe the problem

Right now, we're misusing Docker caching between CI build steps to share the built image. This is fragile as can easily lead to building a different image in each job without noticing.

Instead, the build step should produce the images which would be tested, merged and published, where additional steps would not invoke build.

Describe the solution you would like

There is documentation to follow on this topic: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners

https://docs.docker.com/build/ci/github-actions/share-image-jobs/ might also be useful, but that probably won't work with multi arch images (but might work for testing amd64 images)

Describe alternatives you have considered

No response

Screenshots

No response

Additional context

No response

github-actions[bot] commented 2 months ago

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

nijel commented 1 month ago

As shown in https://github.com/WeblateOrg/docker/pull/2632, pushing won't work from pull requests (we would rather not grant access to images registry to untrusted builds). So probably the only usable approach to this is to use artifacts, but the question is how to make it work with multi-architecture images we need to produce.

nijel commented 4 days ago

Reverting afa5c4c398f9ccce93062cf45de2ef081292fce7 might be a way to go, just use artifacts instead of caches.