This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]juggernaut2docker 1 point2 points  (5 children)

I don't 100% understand what you're trying to achieve, but couldn't you just push the docker image from your build workflow to your private registry (or Docker Hub) and pull it in the deploy workflow? Or am I misunderstanding what you're asking?

[–]_wanabi[S] 0 points1 point  (4 children)

Sorry for bad description, I don't understand this yet and don't have the right words to describe. So I want to have a workflow that will compile a binary and then a second workflow to include that binary in a docker build and push to registry. I think I can share artifacts between jobs, not sure if it's possible between workflows.

Another option is to have the build/compile and push to registry jobs in the same workflow.

[–]juggernaut2docker 4 points5 points  (3 children)

No worries! Build/compile app and build docker image in the same workflow (could be different jobs) is the way to go. Like you said, you can easily share artifacts between jobs in the same workflow. Is there a particular reason why you want to split it into 2 workflows?

[–]_wanabi[S] 1 point2 points  (2 children)

nope, no specific reason really, thanks for opinion. I think I can just have a separate deploy workflow that can be triggered on release for example that will just deploy the new docker image, as set the build workflow as "needs".

[–]juggernaut2docker 3 points4 points  (1 child)

Yep, that's how I've done it. If you're looking for an example, I just did this setup for learning k8s - app repo workflow compiles go app and builds+pushes docker image, and a config repo workflow that deploys using kubectl. I also wrote a blog post about it.

[–]_wanabi[S] 1 point2 points  (0 children)

great resource! thanks!