Skip to content

Bump actions/checkout from 3 to 4 #149

Bump actions/checkout from 3 to 4

Bump actions/checkout from 3 to 4 #149

name: docker-pi-hole-base build
on:
pull_request:
paths:
- 'docker-pi-hole-base/**'
- '.github/workflows/docker-pi-hole-base.yml'
push:
branches:
- "master"
paths:
- 'docker-pi-hole-base/**'
- '.github/workflows/docker-pi-hole-base.yml'
workflow_dispatch:
schedule:
# 1:30am UTC every Sunday, has no particular significance
- cron: "30 1 * * 0"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job:
- { DEBIAN_VERSION: bullseye-slim, PLATFORMS: 'linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6, linux/ppc64le' }
- { DEBIAN_VERSION: sid-slim, PLATFORMS: 'linux/riscv64' }
name: ${{ matrix.job.DEBIAN_VERSION }}
steps:
-
name: Checkout Repo
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKERHUB_NAMESPACE }}/docker-pi-hole-base,enable=${{ github.event_name != 'pull_request' }}
ghcr.io/${{ github.repository_owner }}/docker-pi-hole-base,enable=${{ github.event_name != 'pull_request' }}
foo/bar,enable=${{ github.event_name == 'pull_request' }}
tags: |
${{ matrix.job.DEBIAN_VERSION }}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: docker-pi-hole-base/.
platforms: ${{ matrix.job.PLATFORMS }}
build-args: |
DEBIAN_VERSION=${{ matrix.job.DEBIAN_VERSION }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}