Skip to content

Commit e913b5c

Browse files
authored
Merge pull request #14 from Intellection/release_to_docker_hub
Update release workflow to publish Docker image on Docker Hub
2 parents 81480c1 + f1a1b27 commit e913b5c

File tree

4 files changed

+72
-23
lines changed

4 files changed

+72
-23
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- "[0-9].[0-9]+.[0-9]+"
77

8+
env:
9+
IMAGE: zappi/resque-exporter
10+
811
jobs:
912
github-release:
1013
runs-on: ubuntu-latest
@@ -48,3 +51,43 @@ jobs:
4851
md5sum: true
4952
sha256sum: true
5053
asset_name: resque-exporter-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}
54+
55+
docker-hub-release:
56+
runs-on: ubuntu-latest
57+
needs: release-binaries
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
- name: Prepare Image Metadata
62+
id: metadata
63+
uses: docker/metadata-action@v5
64+
with:
65+
images: ${{ env.IMAGE }}
66+
- name: Set Up QEMU
67+
uses: docker/setup-qemu-action@v3
68+
- name: Set Up Docker Buildx
69+
uses: docker/setup-buildx-action@v3
70+
- name: Login To Docker Hub
71+
uses: docker/login-action@v3
72+
with:
73+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
74+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
75+
- name: Build, tag, and push image to Docker Hub
76+
uses: docker/build-push-action@v6
77+
with:
78+
build-args:
79+
RESQUE_EXPORTER_VERSION=${{ github.ref_name }}
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
82+
context: .
83+
platforms: linux/amd64,linux/arm64
84+
push: true
85+
annotations: ${{ steps.metadata.outputs.annotations }}
86+
labels: ${{ steps.metadata.outputs.labels }}
87+
tags: ${{ steps.metadata.outputs.tags }}
88+
- name: Update Description On Docker Hub Description
89+
uses: peter-evans/dockerhub-description@v4
90+
with:
91+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
92+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
93+
repository: ${{ env.IMAGE }}

.promu.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.4.0
4+
5+
* Migrate from Dep to Go modules.
6+
* Remove vendored packages.
7+
* Upgrade `github.com/prometheus/client_golang` to `v1.20.4`.
8+
* Upgrade `github.com/prometheus/common` to `v0.60.1`.
9+
* Switch from `github.com/prometheus/common/log` to `github.com/sirupsen/logrus`.
10+
* Improve setting and fetching of version information.
11+
* Minor updates to account for package upgrades.
12+
313
## 0.3.0
414

515
#### Changed

Dockerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
FROM quay.io/prometheus/golang-builder as builder
1+
FROM ubuntu:24.04 AS builder
22

3-
COPY . $GOPATH/src/github.com/Intellection/resque-exporter
4-
WORKDIR $GOPATH/src/github.com/Intellection/resque-exporter
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ARG TARGETARCH
5+
ARG TARGETOS
56

6-
RUN make PREFIX=/
7+
RUN apt-get update -qq -y && \
8+
apt-get install --no-install-recommends -qq -y \
9+
ca-certificates \
10+
wget && \
11+
rm -rf /var/lib/apt/lists/*
712

8-
FROM quay.io/prometheus/busybox
9-
MAINTAINER Satoshi Matsumoto <kaorimatz@gmail.com>
13+
ARG RESQUE_EXPORTER_VERSION
14+
ARG RESQUE_EXPORTER_PKG="resque-exporter-${RESQUE_EXPORTER_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz"
15+
RUN cd /tmp/ && \
16+
wget --progress=dot:giga https://github.com/Intellection/resque-exporter/releases/download/${RESQUE_EXPORTER_VERSION}/${RESQUE_EXPORTER_PKG} && \
17+
wget --progress=dot:giga https://github.com/Intellection/resque-exporter/releases/download/${RESQUE_EXPORTER_VERSION}/${RESQUE_EXPORTER_PKG}.sha256 && \
18+
echo "$(cat ${RESQUE_EXPORTER_PKG}.sha256) *${RESQUE_EXPORTER_PKG}" | sha256sum -c - && \
19+
tar --no-same-owner -xzf ${RESQUE_EXPORTER_PKG}
1020

11-
COPY --from=builder /resque-exporter /bin/resque-exporter
21+
FROM ubuntu:24.04
1222

13-
USER nobody:nogroup
23+
COPY --from=builder /tmp/resque-exporter /bin/resque-exporter
1424

25+
USER nobody:nogroup
1526
EXPOSE 9447
1627
ENTRYPOINT ["/bin/resque-exporter"]

0 commit comments

Comments
 (0)