Skip to content

Commit

Permalink
Add release to docker-hub job
Browse files Browse the repository at this point in the history
  • Loading branch information
itskingori committed Nov 20, 2024
1 parent 8d2c97c commit 6f64f78
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "[0-9].[0-9]+.[0-9]+"

env:
IMAGE: zappi/resque-exporter

jobs:
github-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,3 +51,43 @@ jobs:
md5sum: true
sha256sum: true
asset_name: resque-exporter-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}

docker-hub-release:
runs-on: ubuntu-latest
needs: release-binaries
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Image Metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
- name: Set Up QEMU
uses: docker/setup-qemu-action@v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login To Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build, tag, and push image to Docker Hub
uses: docker/build-push-action@v6
with:
build-args:
RESQUE_EXPORTER_VERSION=${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: linux/amd64,linux/arm64
push: true
annotations: ${{ steps.metadata.outputs.annotations }}
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
- name: Update Description On Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE }}

0 comments on commit 6f64f78

Please sign in to comment.