-
Notifications
You must be signed in to change notification settings - Fork 76
56 lines (56 loc) · 1.81 KB
/
build_and_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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@v1
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 }}