mirror of
https://github.com/klutchell/unbound-docker.git
synced 2026-10-16 00:02:47 +00:00
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
97 lines
2.9 KiB
YAML
97 lines
2.9 KiB
YAML
name: docker
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
branches:
|
|
- "main"
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
|
|
env:
|
|
slug: "klutchell/unbound"
|
|
platforms: "linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
|
|
services:
|
|
registry:
|
|
image: registry:2.7.1
|
|
ports:
|
|
- 5000:5000
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: docker.io/${{ env.slug }},ghcr.io/${{ env.slug }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=sha
|
|
type=semver,pattern={{version}}
|
|
|
|
- uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver-opts: network=host
|
|
|
|
- uses: docker/build-push-action@v2
|
|
with:
|
|
platforms: ${{ env.platforms }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
tags: localhost:5000/${{ env.slug }}:local
|
|
cache-to: type=gha,mode=max
|
|
cache-from: |
|
|
type=gha
|
|
${{ steps.meta.outputs.tags }}
|
|
push: true
|
|
|
|
- uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Run tests
|
|
run: |
|
|
for platform in $(tr ',' '\n' <<< "${{ env.platforms }}") ; do
|
|
docker pull --platform ${platform} localhost:5000/${{ env.slug }}:local
|
|
docker run -d --name sut localhost:5000/${{ env.slug }}:local
|
|
docker exec sut unbound -V | tee /dev/stderr | grep -wq "$(head -n1 VERSION)" || { docker logs sut ; exit 1 ; }
|
|
docker exec sut dig sigok.verteiltesysteme.net @127.0.0.1 +dnssec | tee /dev/stderr | grep -wq NOERROR || { docker logs sut ; exit 1 ; }
|
|
docker exec sut dig sigfail.verteiltesysteme.net @127.0.0.1 +dnssec | tee /dev/stderr | grep -wq SERVFAIL || { docker logs sut ; exit 1 ; }
|
|
docker logs sut
|
|
docker rm -f sut
|
|
done
|
|
|
|
- uses: docker/login-action@v2
|
|
if: github.actor == github.repository_owner
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/login-action@v2
|
|
if: github.actor == github.repository_owner
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- uses: akhilerm/tag-push-action@v2.0.0
|
|
if: github.actor == github.repository_owner
|
|
with:
|
|
src: localhost:5000/${{ env.slug }}:local
|
|
dst: |
|
|
${{ steps.meta.outputs.tags }}
|
|
|
|
- uses: peter-evans/dockerhub-description@v3
|
|
if: github.event_name != 'pull_request'
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
repository: ${{ env.slug }}
|