sonda/.forgejo/workflows/probe-arm.yml
tgiachi a2f8993601
Some checks failed
probe-arm / image (arm64) (push) Failing after 8s
probe-arm / image (amd64) (push) Successful in 3m43s
probe-arm / manifest (push) Has been skipped
ci: probe the two-architecture build (throw-away branch)
2026-11-16 14:13:30 +01:00

56 lines
2.1 KiB
YAML

name: probe-arm
on:
push:
branches: [ci/probe-arm]
jobs:
# One image for each architecture, each built by kaniko for its own: the Go program crosses to the other one with no
# emulation, and the last stage of the Dockerfile runs no command (see the Dockerfile).
image:
runs-on: docker
strategy:
matrix:
arch: [amd64, arm64]
container:
image: gcr.io/kaniko-project/executor:v1.23.2-debug
steps:
- name: Build the image from the tag and push it as X.Y.Z-ARCH
env:
VERSION: probe
ARCH: ${{ matrix.arch }}
REGISTRY_USER: squid
REGISTRY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
set -eu
mkdir -p /kaniko/.docker
auth="$(printf '%s:%s' "$REGISTRY_USER" "$REGISTRY_TOKEN" | base64 | tr -d '\n')"
printf '{"auths":{"git.kmalloc.org":{"auth":"%s"}}}' "$auth" > /kaniko/.docker/config.json
/kaniko/executor \
--custom-platform "linux/${ARCH}" \
--dockerfile Dockerfile \
--context "git://git.kmalloc.org/squid/sonda.git#refs/heads/ci/probe-arm" \
--build-arg "VERSION=${VERSION}" \
--label "org.opencontainers.image.version=${VERSION}" \
--destination "git.kmalloc.org/squid/sonda:${VERSION}-${ARCH}" \
--verbosity info
# The tags that people use (X.Y.Z, X.Y, latest) point at a list of the two images, so that each machine takes its own.
manifest:
needs: [image]
runs-on: docker
container:
image: gcr.io/go-containerregistry/crane:debug
steps:
- name: Join the images under X.Y.Z, X.Y and latest
env:
VERSION: probe
REGISTRY_USER: squid
REGISTRY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
set -eu
image=git.kmalloc.org/squid/sonda
crane auth login git.kmalloc.org -u "$REGISTRY_USER" -p "$REGISTRY_TOKEN"
crane index append \
--tag "${image}:${VERSION}" \
--manifest "${image}:${VERSION}-amd64" \
--manifest "${image}:${VERSION}-arm64"
crane tag "${image}:${VERSION}" probe-latest