Skip to content

Commit 09c7038

Browse files
committed
implement github actions
- multiarch build - ci & release pipeline Signed-off-by: Markus Blaschke <[email protected]>
1 parent 5cc366a commit 09c7038

File tree

5 files changed

+71
-2
lines changed

5 files changed

+71
-2
lines changed

.github/workflows/ci-docker.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "CI: docker build"
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Build the Docker image
14+
run: docker build . --file Dockerfile --tag webdevops/alertmanager2es:$(date +%s)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Release: docker"
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * 1'
6+
push:
7+
branches:
8+
- '**'
9+
tags:
10+
- '*.*.*'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Docker meta
18+
id: docker_meta
19+
uses: crazy-max/ghaction-docker-meta@v1
20+
with:
21+
images: webdevops/alertmanager2es,quay.io/webdevops/alertmanager2es
22+
#tag-sha: true
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v1
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v1
29+
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: Login to Quay
37+
uses: docker/login-action@v1
38+
with:
39+
registry: quay.io
40+
username: ${{ secrets.QUAY_USERNAME }}
41+
password: ${{ secrets.QUAY_TOKEN }}
42+
43+
- name: Build and push
44+
uses: docker/build-push-action@v2
45+
with:
46+
context: .
47+
file: ./Dockerfile
48+
platforms: linux/amd64,linux/arm64
49+
push: ${{ github.event_name != 'pull_request' }}
50+
tags: ${{ steps.docker_meta.outputs.tags }}
51+
labels: ${{ steps.docker_meta.outputs.labels }}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN make dependencies
1010

1111
# Compile
1212
COPY ./ /go/src/github.com/webdevops/alertmanager2es
13+
RUN make test
1314
RUN make lint
1415
RUN make build
1516
RUN ./alertmanager2es --help

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ image: build
2929
build-push-development:
3030
docker build -t webdevops/$(NAME):development . && docker push webdevops/$(NAME):development
3131

32+
test:
33+
go test ./...
34+
3235
.PHONY: lint
3336
lint: $(GOLANGCI_LINT_BIN)
3437
# megacheck fails to respect build flags, causing compilation failure during linting.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# alertmanager2es
22

33
[![license](https://img.shields.io/github/license/webdevops/alertmanager2es.svg)](https://github.com/webdevops/alertmanager2es/blob/master/LICENSE)
4-
[![Docker](https://img.shields.io/docker/cloud/automated/webdevops/alertmanager2es)](https://hub.docker.com/r/webdevops/alertmanager2es/)
5-
[![Docker Build Status](https://img.shields.io/docker/cloud/build/webdevops/alertmanager2es)](https://hub.docker.com/r/webdevops/alertmanager2es/)
4+
[![DockerHub](https://img.shields.io/badge/DockerHub-webdevops%2Falertmanager2es-blue)](https://hub.docker.com/r/webdevops/alertmanager2es/)
5+
[![Quay.io](https://img.shields.io/badge/Quay.io-webdevops%2Falertmanager2es-blue)](https://quay.io/repository/webdevops/alertmanager2es)
66

77
This is a forked version of [cloudflare's alertmanager2es](https://github.com/cloudflare/alertmanager2es) with
88
new golang layout and uses the official ElasticSearch client. It also supports Authentication.

0 commit comments

Comments
 (0)