Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github workflow to build containers #381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
name: Build container images

on:
push:
tags:
- "*"

jobs:
docker:
name: Publish container images
runs-on: ubuntu-latest
steps:
# Action reference: https://github.com/actions/checkout
- name: Checkout sources
uses: actions/checkout@v2

# Action reference: https://github.com/docker/metadata-action
- name: Extract metadata
id: meta
uses: docker/metadata-action@v3
with:
images: edenhill/kcat

# Action reference: https://github.com/docker/setup-qemu-action
- name: Set up QEMU (for docker buildx)
uses: docker/setup-qemu-action@v1

# Action reference: https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# Action reference: https://github.com/docker/login-action
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Action reference: https://github.com/docker/build-push-action
- name: Build container image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}