smart-sec-cam icon indicating copy to clipboard operation
smart-sec-cam copied to clipboard

Push docker images to public repo

Open scottbarnesg opened this issue 2 years ago • 2 comments

scottbarnesg avatar Mar 21 '22 01:03 scottbarnesg

Hi, stream-of-consciousness writing, hope this makes sense and saves some time. I use an actions template to push public docker images to github packages, which then can be pulled using a command like docker pull ghcr.io/khlam/<repo name>/<image name>:<image tag>. not sure if this is what you're looking to do,

Quickly wrote this example to illustrate a partial idea, didn't test.

  • https://github.com/khlam/smart-sec-cam/blob/ghcr/backend/smart_sec_cam/motion/.github/workflows/publish.yml

Implementation depends on how you want to organize your project, and I don't know if github actions is flexible enough to support multiple .github/workflows placed in each directory that you want to build an image. If it doesn't support that directory organization then one other option might be moving .github/workflows/ into the project root dir and make a publish.yml for each image and set the appropriate relative path to the Dockerfile.

khlam avatar Mar 21 '22 07:03 khlam

This is fantastic, thank you! I'm used to working with Gitlab-CI so I'm learning how Github Workflows works.

Are you interested in flushing out this out for all the container images? If so I'd be happy to accept a PR for this. We wouldn't need anything crazy to start out, just pushing to the latest tag for each service (redis, server, motion-detection, and frontend) when something gets merged into master.

If not, no worries - I'm happy to take your example and run with it.

scottbarnesg avatar Mar 21 '22 23:03 scottbarnesg