-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Create image workflow #345
base: main
Are you sure you want to change the base?
Create image workflow #345
Conversation
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 think this workflow is duplicating the work of ci-build.yml
, with the additional step (the only difference?) for uploading an image to GH's Docker registry.
From what I understood, the image will be built for each change done to the main
branch. But the image won't have the commit hash, instead if will use the date of the job that generated the change.
I think instead we could:
- push the image manually when necessary specifying the version?
- or push it with the commit hash instead of the date only? Or a combination of both?
- remove the duplicated build process, and build this one only if the build has succeeded? (I think that's doable in GH actions)
workflow now runs only if CWL Viewer Build workflow completes
DATE=$(date +%s) | ||
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | ||
VERSION= ${GIT_HASH}-${DATE} | ||
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} | ||
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${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.
Can you review https://github.com/common-workflow-language/cwlviewer/pull/360/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R216 and incorporate the process documented there?
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.
@obasekiosa let me know if you have questions
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.
specifically, I would like this to match the tagging conventions and the --build-arg
calls (lines 222 - 227) of https://github.com/common-workflow-language/cwlviewer/pull/360/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R216
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.
Nothing to add besides +1 on @mr-c 's comment about re-using the build instructions linked. Great job @obasekiosa !
@obasekiosa I see that this workflow is hard to test in a PR. Drop a link here to the working run on your fork, along with a link to the resulting container on your Docker Hub or quay.io account. Of course, let me know if you have any questions, we can even have a voice chat with screen sharing to troubleshoot any problems that arise. |
run: | | ||
DATE=$(date +%s) | ||
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | ||
VERSION= ${GIT_HASH}-${DATE} |
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.
VERSION= ${GIT_HASH}-${DATE} | |
VERSION=${GIT_HASH}-${DATE} |
Description
Adds a GitHub action that builds and pushes a docker image of the repository to docker hub
images are tagged with docker_username/repo_name:date
Motivation and Context
This allows for the first step in the CD process.
fixes #306
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: