bakdata / ci-templates

Collection of reusable workflows and composite actions for Github
MIT License
4 stars 1 forks source link

Refactor Java Gradle Docker workflow to build and publish Jib image in a single job #200

Open yannick-roeder opened 1 month ago

yannick-roeder commented 1 month ago

Currently our Java Gradle Docker workflow uses 2 separate jobs (build-jib and publish-jib-image) to build a Docker image with Jib as a .tar file and then publish that Docker image to a Docker registry in a separate job. To pass the .tar file between those jobs it is uploaded as a GitHub artifact.

The main issue with this approach is that GitHub artifact uploads and downloads are quite slow, especially for larger files (e.g. a Docker images with multiple GBs). There was already a similar PR for moving away from GitHub artifacts for the Docker Build and Publish workflow.

Ideally we can also make use of the docker/metadata-action to set image metadata before pushing. I'm not sure if we could also use the docker/build-push-action for only pushing images built by Jib.