pihole-exporter/.github/workflows/master.yml

51 lines
1.2 KiB
YAML
Raw Normal View History

2020-05-05 08:47:24 +02:00
name: Build/Push (master)
on:
push:
2020-05-05 08:47:24 +02:00
branches: [ ci ]
pull_request:
2020-05-05 08:47:24 +02:00
branches: [ ci ]
jobs:
2020-05-05 08:47:24 +02:00
test:
runs-on: ubuntu-latest
2020-05-05 08:47:24 +02:00
strategy:
matrix:
go_version: [ '1.12', '1.13', '1.14' ]
steps:
2020-05-05 08:47:24 +02:00
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go_version }}
- run: go get -t -v ./...
- run: go test -v -race ./...
2020-05-05 08:47:24 +02:00
build:
runs-on: ubuntu-latest
2020-05-05 08:47:24 +02:00
needs: test
strategy:
matrix:
include:
- os: linux
arch: amd64
image: scratch
- os: linux
arch: arm
image: arm32v7/alpine:3.11
- os: linux
arch: arm64
image: arm64v8/alpine:3.11
steps:
2020-05-05 08:47:24 +02:00
- uses: actions/checkout@v2
- name: Build/Push docker image (${{ matrix.os }}/${{ matrix.arch }})
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ekofr/pihole-exporter
tags: ${{ matrix.arch }}
build_args: OS=${{ matrix.os }},ARCH=${{ matrix.arch }},IMAGE=${{ matrix.image }}