Skip to content

Force docker build and publish #1

Force docker build and publish

Force docker build and publish #1

---
name: Force docker build and publish
on:
workflow_dispatch:
permissions:
contents: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get latest release of pihole docker container
id: latest_release
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: "pi-hole/docker-pi-hole"
type: "stable"
run: echo release=$(curl --silent "https://api.github.com/repos/pi-hole/docker-pi-hole/releases/latest" | jq -r '.tag_name') >> $GITHUB_OUTPUT
- name: Get previous release tag
id: previous_release
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: "aleksanderbl29/docker-pihole-unbound"
type: "stable"
run: echo release=$(curl --silent "https://api.github.com/repos/aleksanderbl29/docker-pihole-unbound/releases/latest" | jq -r '.tag_name' ) >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
build-args: PIHOLE_VERSION=${{ steps.latest_release.outputs.release }}
context: "{{defaultContext}}:pihole-unbound/"
platforms: linux/arm/v7,linux/arm64/v8,linux/amd64
push: true
tags: aleksanderbl/pihole-unbound:latest,aleksanderbl/pihole-unbound:${{ steps.latest_release.outputs.release }}
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.latest_release.outputs.release }}
name: "${{ steps.latest_release.outputs.release }}"
body: |
This release was force built by @aleksanderbl29
Changelog found on [pi-hole github](https://github.com/pi-hole/docker-pi-hole/releases), please read the changes before updating.
You can update the docker image with:
```
docker compose pull
docker compose up -d
```