Skip to content

Commit

Permalink
publish a docker image to quay for every release (#86)
Browse files Browse the repository at this point in the history
* publish a docker image to quay for every release

Signed-off-by: Josh Gwosdz <[email protected]>

* quote secret injection

Signed-off-by: Josh Gwosdz <[email protected]>

* clean up build workflow

Signed-off-by: Josh Gwosdz <[email protected]>
  • Loading branch information
erdii authored May 7, 2021
1 parent 8397110 commit 63eaeb0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
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
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

0 comments on commit 63eaeb0

Please sign in to comment.