-
Notifications
You must be signed in to change notification settings - Fork 224
Push Docker Images on New Release #1377
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
base: main
Are you sure you want to change the base?
Push Docker Images on New Release #1377
Conversation
Proof that this works can be found here: https://github.com/adnanhemani/polaris/actions/runs/14487217152/job/40635177296 A similar code with a successful push to my personal remote repo can be found here: https://github.com/adnanhemani/polaris/actions/runs/14486887998 |
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.
What's exactly the trigger ?
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 propose to wait after 0.10.0-beta-incubating release as I will push the image as part of the release last step.
|
||
on: | ||
release: | ||
types: [published] |
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.
So, it means that we will push Docker images when release is created on GitHub. That's not required from an Apache standpoint, but good enough.
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.
What's exactly the trigger ?
Continuing this comment as well, you got it correct. I've put the trigger on the GitHub release - this is due to my inexperience with the Apache release process. Is there a better trigger for this potentially?
id-token: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 |
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.
We should checkout on the release tag here, not on main
.
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 per the official documentation for actions/checkout
, this step will check out the exact SHA that triggered the event. So it will be the release tag.
ref: https://github.com/actions/checkout?tab=readme-ov-file#usage
|
||
- name: Push Docker image to Docker Hub | ||
run: | | ||
docker push apache/polaris |
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.
We should push with the image tag (in addition of latest
). Basically:
docker push apache/polaris:{version}
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.
The GitHub metadata that generates the version is a bit wonky and requires some parsing. But I know that when we build the Docker images using ./gradlew
, it creates tags for both the version and latest
. Do you think it is okay to push them all using the docker push apache/polaris --all-tags
?
ref: https://github.com/adnanhemani/polaris/actions/runs/14486887998/job/40634198664#step:7:20
Could you push a current version please? Would love to use this now (having issue with gradlew) |
Another Q, When I built the image using the gradlew command... it outputted in arm64, could you also build for linux/amd64? |
As part of the release process (again 😄 ), we can push multi platform images. |
@aj-hadrian you have to wait 0.10.0-beta-incubating release that will include binary distributions, including Docker images. 0.10.0-beta-incubating release is planned in a couple of weeks (assuming the vote will pass). |
I'm okay with this but wanted to make sure - wouldn't it be easier to test that this is working as we'd like with the |
This adds a new GitHub Action that will push the generated Docker image to the Docker Hub repository located here whenever a new release is cut.
The only requirement left to make this work is to ensure that the Docker username and token that has the ability to authenticate to this repository is available as a GitHub Secret for the Action to use.