Skip to content

fix(webui): preserve checkpoint hashes during rewind (#534) #58

fix(webui): preserve checkpoint hashes during rewind (#534)

fix(webui): preserve checkpoint hashes during rewind (#534) #58

Workflow file for this run

name: Gateway Docker
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: Existing release tag to publish, for example v0.1.0
required: true
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/liveagent-gateway
jobs:
build-and-push:
name: Build and Push Gateway Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=raw,value=${{ github.event.inputs.tag || github.ref_name }}
type=raw,value=latest
- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
# Guard against mislabeled variants: v0.1.0 through v1.1.8 advertised
# arm64 while shipping an x86-64 binary (TARGETARCH defaults in the
# Dockerfile shadowed the values buildx injects).
- name: Verify per-arch binaries
run: |
set -euo pipefail
repo="$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')"
index="$repo@${{ steps.push.outputs.digest }}"
for arch in amd64 arm64; do
case "$arch" in
amd64) want="x86-64" ;;
arm64) want="aarch64" ;;
esac
# Pull each variant by its own manifest digest. Pulling the shared
# index digest with --platform binds repo@digest to one platform,
# so the second arch fails with "cannot overwrite digest".
digest="$(docker buildx imagetools inspect --raw "$index" \
| jq -r --arg arch "$arch" '.manifests[] | select(.platform.os == "linux" and .platform.architecture == $arch) | .digest')"
test -n "$digest" || { echo "::error::pushed index has no linux/$arch manifest"; exit 1; }
docker pull "$repo@$digest" >/dev/null
docker rm -f "verify-$arch" >/dev/null 2>&1 || true
docker create --name "verify-$arch" "$repo@$digest" >/dev/null
docker cp "verify-$arch:/usr/local/bin/liveagent-gateway" "/tmp/gateway-$arch"
docker rm -f "verify-$arch" >/dev/null
info="$(file -b "/tmp/gateway-$arch")"
echo "linux/$arch: $info"
echo "$info" | grep -q "$want" || { echo "::error::linux/$arch image contains a non-$arch gateway binary"; exit 1; }
done