Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish a docker image to quay for every release #86

Merged
merged 3 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build-docker

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.14.x
- uses: actions/checkout@v2
- name: Login to quay.io Docker Image Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: "${{ secrets.QUAY_USER }}"
password: "${{ secrets.QUAY_PASS }}"
- run: make docker docker-publish
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add something like https://github.com/thanos-io/thanos/blob/main/Makefile#L5 to build from main.

env:
DOCKER_IMAGE_TAG: ${{ github.event.release.tag_name }}
- run: make docker docker-publish
env:
DOCKER_IMAGE_TAG: latest
File renamed without changes.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
FROM circleci/golang:1.14 AS builder
COPY . /go/src/github.com/prometheus-community/jiralert
RUN mkdir -p /go/src/github.com/prometheus-community/jiralert && sudo chown -R circleci:circleci /go/src/github.com/prometheus-community/
FROM golang:1.14 AS builder
WORKDIR /go/src/github.com/prometheus-community/jiralert
COPY . /go/src/github.com/prometheus-community/jiralert
RUN GO111MODULE=on GOBIN=/tmp/bin make

FROM quay.io/prometheus/busybox-linux-amd64:latest

COPY --from=builder /go/src/github.com/prometheus-community/jiralert/jiralert /bin/jiralert

ENTRYPOINT [ "/bin/jiralert" ]

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DOCKER_REPO ?= quay.io/jiralert
DOCKER_IMAGE_NAME ?= jiralert

include Makefile.common