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

Automatically update one-container image with new pihole images #252

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mpgirro
Copy link

@mpgirro mpgirro commented Sep 15, 2024

This PR adds automation to update the pihole image in the Dockerfile when new versions become available. It does so by:

  • Adding Renovate bot to update the version tag of Pihole in Dockerfile. You need to activate the Renovate App for this repository (it's free). Renovate normally opens PRs for manual review and approval. I've configured it to not open PRs for updates to the Dockerfile, but automatically commit all Docker tag updates without the need for manual interaction.

  • Adding a GitHub Actions workflow that builds and pushed the new images. This is only triggered when the Dockerfile is updated. The image gets tagged with the same version tag as the new pihole tag, as well as latest. New images get pushed to Docker Hub under your account, as well as GitHub Container Registry (GHCR) – simply because it's simply integrated to this repo.

Setup steps required to enable the new features

It's not sufficient to merge this PR. You need to do a few simple steps initially to enable the automation.

Activate the Renovate App for this repository. Afterwards, in the app settings at the bottom under "Repository access", add this repository so Renovate can start processing this repo. You will get an onboarding PR automatically if you do this before merging this PR. It's not necessary to merge this, since this PR already has the required renovate.json file.

Add a new variable for GitHub Actions called DOCKERHUB_USERNAME with your Docker Hub username.

Add a new secret for GitHub Actions called DOCKERHUB_TOKEN with an personal access token for Docker Hub. Generate the token here. The tokens needs "Read & Write" permissions.

@mpgirro
Copy link
Author

mpgirro commented Sep 15, 2024

I've tested and verified that the automation works in my fork repo. It's already pushing new images automatically to Docker Hub and GHRC

@mpgirro
Copy link
Author

mpgirro commented Sep 15, 2024

I've update the PR to automatically create a GitHub release in the same style as the history release notes (preview)

@mpgirro mpgirro force-pushed the main branch 3 times, most recently from 36a230f to e9a2169 Compare September 25, 2024 19:03
@mpgirro mpgirro force-pushed the main branch 3 times, most recently from f779d58 to 3170564 Compare September 26, 2024 08:28
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@chriscrowe
Copy link
Owner

I've actually been looking to hand this repo over to someone else for a while -- this implementation looks good. Are you interested in becoming the official repo for this project?

@mpgirro
Copy link
Author

mpgirro commented Sep 30, 2024

Yes, I can take over this project.

How do you want to do this? Transfer the repository to me?

@BoBBer446
Copy link

Where is the dockerfile ?

@mpgirro
Copy link
Author

mpgirro commented Nov 13, 2024

@BoBBer446 The Dockerfile is located at one-container/pihole-unbound/Dockerfile

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.

3 participants