fix: replace buildctl push with skopeo for simpler registry auth

This commit is contained in:
Mathias Bergqvist
2026-04-21 07:05:44 +02:00
parent 19b019a8d8
commit 7bf19b6a7b

View File

@@ -20,14 +20,25 @@ jobs:
- name: Build and push image - name: Build and push image
run: | run: |
set -e
trap 'rm -f /tmp/supervisor-image.tar' EXIT
IMAGE_TAG="${{ github.sha }}" IMAGE_TAG="${{ github.sha }}"
echo "Building ${IMAGE}:${IMAGE_TAG}" echo "Building ${IMAGE}:${IMAGE_TAG}"
# Build to local OCI tar (no registry auth needed at build time)
buildctl --addr "${BUILDKIT_HOST}" build \ buildctl --addr "${BUILDKIT_HOST}" build \
--frontend dockerfile.v0 \ --frontend dockerfile.v0 \
--local context=. \ --local context=. \
--local dockerfile=. \ --local dockerfile=. \
--opt build-arg:VERSION="${IMAGE_TAG}" \ --opt build-arg:VERSION="${IMAGE_TAG}" \
--output "type=image,name=${IMAGE}:${IMAGE_TAG},push=true" --output type=oci,dest=/tmp/supervisor-image.tar
# Push with skopeo using simple credential flag (avoids OAuth token flow)
skopeo copy \
oci-archive:/tmp/supervisor-image.tar \
docker://${IMAGE}:${IMAGE_TAG} \
--dest-creds "${{ secrets.REGISTRY_CREDS }}"
echo "Built and pushed ${IMAGE}:${IMAGE_TAG}" echo "Built and pushed ${IMAGE}:${IMAGE_TAG}"
- name: Update infra repo - name: Update infra repo