Skip to content

Commit

Permalink
Merge pull request #1438 from dennisameling/add-build-on-tag
Browse files Browse the repository at this point in the history
Add CI pipeline for building and pushing multi-arch Docker image
  • Loading branch information
jamesdbloom authored Aug 21, 2022
2 parents f8581ad + ec4d919 commit 128fcb2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and push Docker image to Docker Hub
on:
push:
tags:
- mockserver-*

jobs:
build-and-push-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get tag name
id: get_tag_version
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: mockserver/mockserver:${{ steps.get_tag_version.outputs.version }}

0 comments on commit 128fcb2

Please sign in to comment.