diff --git a/.github/workflows/build-docker.yaml b/.github/workflows/build-docker.yaml new file mode 100644 index 0000000..752d673 --- /dev/null +++ b/.github/workflows/build-docker.yaml @@ -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 diff --git a/.github/workflows/main.yaml b/.github/workflows/test.yaml similarity index 100% rename from .github/workflows/main.yaml rename to .github/workflows/test.yaml diff --git a/Dockerfile b/Dockerfile index de0d284..c2931bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -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 @@ -9,4 +8,3 @@ FROM quay.io/prometheus/busybox-linux-amd64:latest COPY --from=builder /go/src/github.com/prometheus-community/jiralert/jiralert /bin/jiralert ENTRYPOINT [ "/bin/jiralert" ] - diff --git a/Makefile b/Makefile index 90e1d97..638aea2 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +DOCKER_REPO ?= quay.io/jiralert DOCKER_IMAGE_NAME ?= jiralert include Makefile.common