nebulous / infinitude

Open control of Carrier/Bryant thermostats
MIT License
225 stars 50 forks source link

Automated Multiarchitecture Docker Builds using github workflows and actions #110

Closed scyto closed 3 years ago

scyto commented 3 years ago

This PR has bunch of changes, I will quickly summarize the files changes and what you need to note:

  1. .github/workflows/docker-buildx-pushto-dockerhub.yml- this file builds the docker images from the dockerfile; i commented the file so it should be relatively obvious. you would need to setup secrets in your github with the same secret names (but your unique secrets) no need to put secrets in anything anyone can see. it is coded to rebuild when any file changes except README.md (i.e. no rebuilds because one just modified the readme) or the next file. You would need to change the destination docker hub repo for yours.

  2. .github/workflows/update-dockerhub-description-readme.yml - this workflow pushes the readme.md when it is modified, it coded to only push the readme.md and description field on dockerhub. You would need to change the destination docker hub repo for yours and make sure you set the additonal password secret (it can't use API SECRET or Personal Secrets, so if you have MFA configured on your dockerhub this will fail. Known Issue with API that is being worked on.

  3. Dockerfile - mmm there were good reason i switched to debian (maybe because it supports more architectures) but i can't recall now. YMMV and i am not advocating you move to it, but i know every time i start from scratch i end up doing this from our dockerfile for somereason. I also made it more formal as i noted somethings missing or inconsitent wrt YAML file. I also switched to CMD as the entry point - that's my preference as it is more flexible IMO; but thats a style thing, so up to you. Note i have not tested the workflow with your docker file.

  4. README.md - yup you can ignore all changes.

  5. docker-compose.yaml - just change to our repo name

  6. entrypoint.sh - no idea what i changed there? maybe removed a CR at end of file?

  7. infinitude - i don't think i edited this file so I assume the differences are because you enabled debug logging on current version and reformatted some stuff i am behind in my repo?

nebulous commented 3 years ago

Interesting. So you're getting Github to build the images rather than Dockerhub?

Could you merge into or rebase onto the infinitude master branch in this PR? Some of the changes are spurious and that should shrink down the diff.

adamurban commented 3 years ago

Just pulled / tested the latest scyto/infinitude docker image on my pi running Home Assistant; it seems to still work great. Looking forward to this PR getting cleaned up and merged; let me know how I can help.

nebulous commented 3 years ago

actually, no need to fight with git just to clean up this PR. I can pull the changes into a branch and make the required edits 👍

scyto commented 3 years ago

Cool, thanks for making that painless, at some point i need a pointer on how to rebase my fork (or do i just delete it and refork?)

scyto commented 3 years ago

Interesting. So you're getting Github to build the images rather than Dockerhub?

Yes, and even better they migrated this to official docker maintained actions 25 days ago. So this is brand new, works, and is supported (as much as anything OSS is). Now you have seen it in action and looked at the files - its pretty slick and pretty easy and maintainable isn't it!

nebulous commented 3 years ago

Yep, that’s pretty sweet. And you’re the one who made it easy. Merged in #111