Merge pull request #42 from 4km3/dependabot/github_actions/docker/log… #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
version: | |
- { | |
distro: alpine, | |
rel: 3.14, | |
dnsmasq: 2.85-r2, | |
tag: "4km3/dnsmasq:2.85-r2", | |
} | |
- { | |
distro: alpine, | |
rel: 3.15, | |
dnsmasq: 2.86-r0, | |
tag: "4km3/dnsmasq:2.86-r0", | |
taglatest: "4km3/dnsmasq:latest", | |
} | |
- { distro: alpine, rel: edge, dnsmasq: 2.86-r0 } | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check credentials | |
id: docker-credentials | |
run: | | |
echo ::set-output name=defined::$(test -n "${{ secrets.DOCKERHUB_USERNAME }}" && echo true || echo false) | |
- 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 | |
if: steps.docker-credentials.outputs.defined == 'true' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
if: steps.docker-credentials.outputs.defined == 'true' | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
build-args: ALPINE_VERSION=${{ matrix.version.rel }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
"4km3/dnsmasq:${{ matrix.version.dnsmasq }}-${{ matrix.version.distro }}-${{ matrix.version.rel }}" | |
${{ matrix.version.tag }} | |
${{ matrix.version.taglatest }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |