Skip to content
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

GitHub Actions to automatically run black/isort/autoflake and build docker image #31

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Adminiuga
Copy link

@Adminiuga Adminiuga commented Sep 4, 2023

This PR adds a GitHub action to automatically run black, isort & autoflake (leveraging pre-commit) and than builds a docker image pushed to Github Container Registry.

This expands on #23 but instead uses https://pre-commit.com/index.html The advantages, when you have pre-commit installed and then do pre-commit install in your local repository, then all these checks are run automatically for each commit locally, thus you always submit the code which would pass GH action "lint" And you can easily add any additional hooks if needed, e.g. markdown lint for Readme.md

For the Docker image publishing, I suggest slightly adjusting the process, where:

  1. dev branch becomes the default branch, where all the PRs are getting merged and all the development is done. Whenever a PR is merged into dev branch, a new docker image is built and published with dev tag into GitHub Container Registry
  2. master branch becomes a "version history" branch, where push a PR from the dev branch, when ready to make a new release. Thus, the master branch essentially always has the "stable" and working version of the app. When ready to publish a "stable" version after the PR into master in merged, then you "publish" and tag a release in GitHub. This would cause the docker image with the same tag to be published into registry, which also becomes the latest docker image tag.

if you accept this PR, then I can rebase the #30 later, as they are likely to cause merge conflicts.

++ @bertybuttface for visibility

@bertybuttface
Copy link

This is better than my approach. I also now know how to use Home Assistant ingress properly with relative URLs so I can update the Home Assistant Addon and get this working properly too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants