Skip to content

Release Docker Images #2

Release Docker Images

Release Docker Images #2

Workflow file for this run

# Runs after release-please creates a new release
# Builds and pushes the docker images for the release
name: Release Docker Images
on:
release:
types: [released]
jobs:
build-and-push-dockerimage:
name: Buld and push dockerimage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.ref_name }}
# minimal (short sha)
type=sha,prefix=
# full length sha
type=sha,format=long,prefix=
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#registry-cache
cache-from: type=gha
cache-to: type=gha,mode=max