Skip to content

Commit

Permalink
publish image on release (#174)
Browse files Browse the repository at this point in the history
* add a Dockerfile, use an action to build and publish it, and update readme to reflect
  • Loading branch information
ipitio authored Apr 26, 2024
1 parent 743d5d7 commit 5c7ffb6
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 7 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create and publish a Docker image

on:
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
etc*
*\.yml
compose.yml
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM pihole/pihole:latest
RUN curl -sSLN https://github.com/arevindh/pi-hole/raw/master/advanced/Scripts/speedtestmod/mod.sh | sudo bash
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,27 @@ Pull requests and suggestions are welcome!

Please use our Mod Script to install the latest version of the Mod; it automates the process of swapping Pi-hole's repos to our modded ones and ensures this is done efficiently. To see available options, please look at the [wiki](https://github.com/arevindh/pihole-speedtest/wiki). For information about running Pi-hole in Docker, including a Compose example, please refer to the official [repo](https://github.com/pi-hole/docker-pi-hole/) and [docs](https://docs.pi-hole.net/).

> **Docker Note**
> You'll need to run the script inside every new container if you're not using Compose.
### Via the Shell

You can just pipe to bash!
You can just pipe to bash:

curl -sSLN https://github.com/arevindh/pi-hole/raw/master/advanced/Scripts/speedtestmod/mod.sh | sudo bash

### Docker Compose
### With Docker

Simply change the image you're using to our modded one:

ghcr.io/ipitio/pihole-speedtest:latest

#### Compose

Choose one of the following options:

* Change the `image: ...` line to point to our image,
* Replace it with the following and rebuild without cache, or
* Run the Mod Script manually inside every new container.

Replace `image: pihole/pihole:latest` with the following in your `compose.yml`, then rebuild without cache.
The last option is not recommended.

build:
dockerfile_inline: |
Expand Down

0 comments on commit 5c7ffb6

Please sign in to comment.