-
Notifications
You must be signed in to change notification settings - Fork 17
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
Updating CI workflow (Deploying docker images to docker hub) #179
Conversation
cc @rcrichton |
I think triggering releases when tags are created is pretty standard,
that's what we do in a lot of other repos. It also then ties into github
releases.
This PR will probably take a while to make it to main, are you able to run
the script manually for now to generate beta release images on docker hub?
…On Thu, Feb 15, 2024 at 9:03 AM Chido ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .github/workflows/deploy-images-dockerhub.yml
<#179 (comment)>:
> @@ -0,0 +1,54 @@
+name: Deploy Images to DockerHub
+
+on:
Hi @rcrichton <https://github.com/rcrichton> . Yes, I did think of this,
but my worry was that it would trigger for any random tag/release creation
(which might not be what we want). Throught it might be better to be more
specific in regards to this. p.s you can also configure a local docker
repo, of which when configure images are pushed to this on merge
automatically (with the short commit hash as the tag). It's only when
pushing to docker hub when someone will need to be more specific.
—
Reply to this email directly, view it on GitHub
<#179 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACBCUA2DHCGYNUAAJFYEXLYTWXKJAVCNFSM6AAAAABDJVBXR2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQOBRHE2DCMJXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
<http://www.jembi.org> *Ryan Crichton *
*Head of Engineering *
***@***.***
Skype: ryan.graham.crichton
Jembi Health Systems | Durban
<https://www.jembi.org/contact>www.jembi.org
*This e-mail contains proprietary and confidential information some or all
of which may be legally privileged. It is for the intended recipient only.
If an addressing or transmission error has misdirected this e-mail, please
notify the author by replying to this e-mail and then deleting same. If you
are not the intended recipient you must not use, disclose, distribute,
copy, print or rely on this e-mail. Jembi Health Systems NPO, its
subsidiaries and associated companies is not liable for the security of
information sent by e-mail and accepts no liability of whatsoever nature
for any loss, damage or expense resulting, directly or indirectly, from the
access of this e-mail or any attachments hereto.*
|
Hi @rcrichton ..okay, will make it push to docker hub on release. |
Hi @rcrichton . Have updated this to push to dockerhub on release 👍🏽
Hi @rcrichton . Have updated this to push to dockerhub on release 👍🏽 |
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.
Looks good in general, just a few more comments.
source "$HOME/.nvm/nvm.sh" | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
source $GITHUB_WORKSPACE/devops/linux/docker/conf.env | ||
source $GITHUB_WORKSPACE/devops/linux/docker/conf/images/conf-app-images.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.
It looks like we will use the default app images for docker hub. I don't think these will be suitable as there are already images names that we should reuse - https://hub.docker.com/search?q=jempi
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.
Hmm...okay, noted. Will update as appropiate 👍🏽
name: docker-images-${{ inputs.image-build-tag }} | ||
path: | | ||
./.github/workflows/actions/docker-images-save/docker-images/ | ||
retention-days: 2 |
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.
Do we really need to store these artifacts? Why not rather push to dockerhub with a commit hash as the tag? Then they are always available.
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's mainly there for debugging purpose (hence the rentention only 2 days). Regarding pushing to docker hub, I think the plan was only to push images for main/releases, least dockerhub becomes too convoluted (and could also end up includes bugy images). @w-hayes thoughts?
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 just think we are going to pay for storing these. I think pushing them to a tag or doing not saving at all makes the most sense.
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.
Okay, will make it manual workflow (in case someone wants to use it to debug), and remove it from the event driven workflows. If this fine?
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.
Cool, that sounds fine.
Hi @rcrichton ...have update this. If there are any other changes, do let me know, else would be great to merge it in. |
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.
Ok nice, looks good to me.
I'm happy with this, I think we can merge unless others need to review? |
Ticket: N/A
Other Related Tickets: N/A
Describe of changes
This change update our github workflow by adding three new workflow, of which these are highlighted below
OnPullRequest
This workflow is run when a pull request to
dev
ormain
is created. The jobs it executes are highlighted belowBelow is a short description of each job
preprare
lint-check
build-check
test
continue-on-error
is set to true on this job though, so workflow should still complete regardless. Once the test are updated they will be need to setcontinue-on-error
to falsesmoke-test
OnMerge
This workflow runs one a branch has been merged to
dev
ormain
. The jobs it executes are highlighted belowBelow is a short description of each job
preprare
build-save-deploy-images
docker load --input <archive>
DOCKER_LOCAL_DEV_USER_NAME
DOCKER_LOCAL_PASSOWRD
DOCKER_LOCAL_HOST_NAME
Deploy Images to Docker Hub
This workflow executed the same workflow as
OnMerge
above, with a few differences.tag
that will be used for your docker imagetag
you want to useIn addition to this you will need to configure the following secret value (Setting > Setting and variables > Actions > Secrets (tab) > Repository secrets) for this to work
-
DOCKER_HUB_USER_NAME
-
DOCKER_HUB_PASSOWRD
How to test / configure
Other notes: