Skip to content
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

ci: use Docker Bake for build and push #1185

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Conversation

akijakya
Copy link
Contributor

@akijakya akijakya commented Feb 8, 2024

Description

Use Docker Bake for build and push workflows.

Build and push is now image name agnostic, meaning that it only takes a bake group name as input and builds the target images defined in the group as long as the bake target name is the same as the image name. The reusable-build-and-push now splits the bake group into its targets and builds them in a matrix with the build-and-push-component, which also builds the target in a matrix of the defined platforms.

As a result of this, the image names are not calculated beforehand, instead, they are the output of the bake action, so only parts from reusable-image-names.yml were used instead of the workflow itself in this build process (I kept it for the reusable-end-to-end-testing workflow but I think those two now could also be merged). Also, image names are uploaded as artifacts for other jobs to use.

Fixes #1157

Type of Change

[ ] Bug Fix
[ ] New Feature
[ ] Breaking Change
[X] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@akijakya akijakya added the ci Continious Integration related PRs label Feb 8, 2024
@akijakya akijakya self-assigned this Feb 8, 2024

This comment has been minimized.

This comment has been minimized.

@akijakya akijakya marked this pull request as ready for review February 8, 2024 17:09
@akijakya akijakya requested a review from a team as a code owner February 8, 2024 17:09

This comment has been minimized.

ramizpolic
ramizpolic previously approved these changes Feb 9, 2024
Copy link
Member

@ramizpolic ramizpolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added one note to consider, otherwise lgtm 🚀

.github/workflows/reusable-build-and-push.yml Outdated Show resolved Hide resolved
Signed-off-by: András Jáky <ajaky@cisco.com>
Signed-off-by: András Jáky <ajaky@cisco.com>
Signed-off-by: András Jáky <ajaky@cisco.com>
Copy link

Hey!

Your images are ready:

  • ghcr.io/openclarity/vmclarity-apiserver-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515
  • ghcr.io/openclarity/vmclarity-cli-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515
  • ghcr.io/openclarity/vmclarity-cr-discovery-server-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515
  • ghcr.io/openclarity/vmclarity-orchestrator-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515
  • ghcr.io/openclarity/vmclarity-ui-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515
  • ghcr.io/openclarity/vmclarity-ui-backend-dev:pr1185-58d469aba0b5d2e75f4618c5db5c417937c60515

@akijakya akijakya added this pull request to the merge queue Feb 14, 2024
Merged via the queue into main with commit 6133fde Feb 14, 2024
37 checks passed
@akijakya akijakya deleted the ci-use-bake-for-builds branch February 14, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continious Integration related PRs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

GHA to use docker bake for building and publishing images
3 participants