3DGI / tyler

Tiling 3D city models encoded in CityJSON
Apache License 2.0
29 stars 4 forks source link

Build a dockerfile upon releasing and publish it to the github registry #40

Closed mvriel closed 1 year ago

mvriel commented 1 year ago

Fixes https://github.com/3DGI/tyler/issues/18

In this change, I have introduced a github action file that builds and publishes a docker image to the Github registry. I have used the action from https://github.com/elgohr/Publish-Docker-Github-Action to do so, and set it to only build a docker image upon publishing a github release. The tags will follow semver, thus if a release is tagged with v1.2.3; it will create tag 1, 1.2 and 1.2.3.

Unfortunately, I have not been able to test this specific config because it only triggers upon publishing a release; it is based on the publishing flow in phpDocumentor (https://github.com/phpDocumentor/phpDocumentor/actions/runs/5451013134/workflow) but with tweaks for semver and for the alternate dockerfile location.

balazsdukai commented 1 year ago

Thank you for this! Is it possible that the docker build takes a VERSION argument, eg. VERSION=0.3.5? And to push to docker hub instead of the github registry?

mvriel commented 1 year ago

Sorry, I had received your message but hadn't got around yet.I'll dive into it, because these things are certainly possible :)

mvriel commented 1 year ago

Changes have been pushed, make sure you configure a secret called DOCKER_USERNAME and DOCKER_PASSWORD in your Github settings. These are your Docker Hub credentials that are used to push the built image.

I do have to add a disclaimer, since I haven't been able to test this (for obvious reasons), it may fail. If it does, I will take a deeper look.

We are looking to use this tool in Netherlands3D, and it would be awesome if we do not need to maintain the docker image ourselves but instead refer to a canonical version provided here :)

mvriel commented 1 year ago

@balazsdukai have you had time to look at this? I am really curious whether it all works as expected or needs a tweak :)

balazsdukai commented 1 year ago

Thanks for your help @mvriel!