Skip to content

Workflow file for this run

name: Build and Publish Docker images
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
SINK_IMAGE_NAME: ${{ github.repository }}-sink
API_IMAGE_NAME: ${{ github.repository }}-api
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for git describe
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Sink
id: meta-sink
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.SINK_IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Extract metadata (tags, labels) for API
id: meta-api
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Sink image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
target: sink
push: true
tags: ${{ steps.meta-sink.outputs.tags }}
labels: ${{ steps.meta-sink.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push API image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
target: api
push: true
tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta-api.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max