Skip to content

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

adnanhemani
Copy link
Collaborator

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.

@adnanhemani
Copy link
Collaborator Author

Closes #1153 and #152

@adnanhemani
Copy link
Collaborator Author

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

Copy link
Member

@jbonofre jbonofre left a 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 ?

Copy link
Member

@jbonofre jbonofre left a 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]
Copy link
Member

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.

Copy link
Collaborator Author

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
Copy link
Member

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.

Copy link
Collaborator Author

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
Copy link
Member

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}

Copy link
Collaborator Author

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

@aj-hadrian
Copy link

Could you push a current version please? Would love to use this now (having issue with gradlew)

@aj-hadrian
Copy link

aj-hadrian commented Apr 16, 2025

Another Q, When I built the image using the gradlew command... it outputted in arm64, could you also build for linux/amd64?

@jbonofre
Copy link
Member

As part of the release process (again 😄 ), we can push multi platform images.

@jbonofre
Copy link
Member

Could you push a current version please? Would love to use this now (having issue with gradlew)

@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).

@adnanhemani
Copy link
Collaborator Author

I propose to wait after 0.10.0-beta-incubating release as I will push the image as part of the release last step.

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 0.10.0-beta-incubating release? I'm okay with waiting if there is some hesitation with this new workflow - but would like to know what that is, if any, so I may try help to mitigate that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants