-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Intellection/add_test_and_release_workflows
Add test and release workflows to build multi-arch Docker image
- Loading branch information
Showing
5 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
github: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: Version ${{ github.ref_name }} | ||
draft: false | ||
prerelease: false | ||
|
||
docker-hub: | ||
needs: github | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE: zappi/celery-exporter | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: danihodovic/celery-exporter | ||
ref: "v${{ github.ref_name }}" | ||
- 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: | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
# Update this to the exact version that you want to test i.e. the packaging | ||
# into a Docker image. | ||
VERSION: 0.10.14 | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE: zappi/celery-exporter | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: danihodovic/celery-exporter | ||
ref: v${{ env.VERSION }} | ||
- 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: Test Multi-Arch Building Of Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: false | ||
annotations: ${{ steps.metadata.outputs.annotations }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
tags: ${{ steps.metadata.outputs.tags }} |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @Intellection/SRE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# docker-celery-exporter | ||
Docker image for celery-exporter, a Prometheus exporter for Celery metrics | ||
|
||
Docker image for [`danihodovic/celery-exporter`](https://github.com/danihodovic/celery-exporter), a Prometheus exporter for Celery metrics. | ||
|
||
## Motivations | ||
|
||
### How does this differ from upstream? | ||
|
||
The current Docker image doesn't support ARM and we needed one that does. And [the review to add support](https://github.com/danihodovic/celery-exporter/pull/329) took longer than we could wait. | ||
|
||
## Usage | ||
|
||
``` | ||
docker run --name celery-exporter zappi/celery-exporter:latest | ||
``` | ||
|
||
For more detailed usage documentation [see upstream](https://github.com/danihodovic/celery-exporter). |