Skip to content

Image

Image #220

Workflow file for this run

name: Image
# Build and push the konnector image. Pushes only on tags:
# - tags v* -> ghcr.io/<owner>/konnector:<version>
# No :latest or :<sha> tags — the image repo is shared with v1/main images.
on:
push:
tags:
- 'v*'
permissions:
contents: read
packages: write
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Compute image tags
id: meta
run: |
owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
image="ghcr.io/${owner}/konnector"
tags="${image}:${GITHUB_REF_NAME}"
{
echo "image=${image}"
echo "tags=${tags}"
} >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Login to GitHub Container Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Multi-arch via in-Dockerfile cross-compile (builder pinned to
# BUILDPLATFORM), so no QEMU is required.
- name: Build and push
run: |
tag_args=""
for t in ${{ steps.meta.outputs.tags }}; do tag_args="${tag_args} --tag ${t}"; done
docker buildx build \
--platform linux/amd64,linux/arm64 \
${tag_args} \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.title=konnector" \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--provenance=false \
--push \
.