-
Notifications
You must be signed in to change notification settings - Fork 5.9k
fix(ci): build+push image in release flow #3838
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3838 +/- ##
=======================================
Coverage 63.40% 63.40%
=======================================
Files 36 36
Lines 1872 1872
Branches 379 379
=======================================
Hits 1187 1187
Misses 582 582
Partials 103 103 Continue to review full report at Codecov.
|
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.
As someone who is less familiar with Docker/buildx, I don't think I have enough exp to approve this.
However from a general standpoint,
- great PR description
- this approach feels clean and maintainable
- i appreciate you taking extra precautions and separating into it's own workflow
ci/steps/build-docker-image.sh
Outdated
@@ -1,12 +1,37 @@ | |||
#!/usr/bin/env bash |
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.
Should we rename this file? Maybe build-and-push-docker-image.sh
?
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 did consider this but felt it was a bit of a mouthful - though am not opposed to it!
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.
It does seem a bit long haha but I don't want to mislead anyone who might try to run this!
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.
Could maybe shorten to docker-buildx-push.sh
or something.
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.
Sounds great!
ci/steps/build-docker-image.sh
Outdated
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||
fi | ||
|
||
docker buildx bake -f ci/release-image/docker-bake.hcl --push |
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.
Legend! So much better.
Maybe we should rename the publish workflow as well since it's not the full publish process anymore. |
@oxy just checking in on this. Anything we can do to help you move this forward? |
@jsjoeio @code-asher ready for a second look and merge! |
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.
LGTM! Great work on keeping it clean and easy to follow 👏
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.
🎉
Previously, we would build docker images on each CI run, export them, then re-import them and push them on release. However, there appears to be a bug in buildx's export flow, and images can't be re-imported into Docker.
To fix this, I've moved to building and publishing with buildx in the release workflow in one step, and removed the image build step from the main CI flow. I also moved the docker publish process to its own workflow instead of
release.yml
so that it can be re-run independently of the npm+homebrew step.Partially adresses #3814, though a new release needs to be made for the workflow to kick in.