1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-30 21:20:59 +02:00
docker-pi-hole/.github/workflows/test-and-build.yaml
Dan Schaper 4782f15123
Add DOCKERHUB_NAMESPACE variable.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-10-03 13:41:31 -07:00

59 lines
1.6 KiB
YAML

name: Test & Build
on:
push:
branches:
- dev
pull_request:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
env:
ARCH: amd64
DEBIAN_VERSION: buster
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Run Tests
run: |
echo "Building ${ARCH}-${DEBIAN_VERSION}"
./gh-actions-test.sh
build-and-publish:
if: github.event_name != 'pull_request'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the tag name
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6, linux/ppc64le
build-args: |
PIHOLE_VERSION=${{ env.TAG }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}