1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-22 07:26:44 +02:00
docker-pi-hole/.github/workflows/test-and-build.yaml
dependabot[bot] 4fa8bbe04c
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 20:46:18 +00:00

86 lines
2.3 KiB
YAML

name: Test & Build
on:
schedule:
- cron: '0 2 * * *'
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@v3
- 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
if: github.event_name != 'schedule'
uses: actions/checkout@v3
-
name: Checkout dev branch if we are building nightly
if: github.event_name == 'schedule'
uses: actions/checkout@v3
with:
ref: dev
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: |
${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
ghcr.io/${{ github.repository_owner }}/pihole
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
type=schedule
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
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
build-args: |
PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}