mirror of
https://github.com/luxfi/aml.git
synced 2026-09-24 00:25:20 +00:00
ci(docker): inline native multi-arch buildx (drop broken cross-org reusable)
Builds on luxfi-org ARC runners per-arch (lux-build-linux-amd64, lux-build-linux-arm64), pushes by-digest, then assembles a multi-arch manifest tagged with the semver release tag plus :latest. No QEMU, no cross-org workflow_call.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
name: Docker
|
||||
|
||||
# Native multi-arch container build for ghcr.io/luxfi/aml on luxfi-org ARC runners.
|
||||
# No cross-org reusable, no QEMU — each arch builds on its own native runner.
|
||||
# Manifest is assembled from per-arch digests, then pushed with the
|
||||
# semver tag (on `v*` tags) or the branch alias (on main/dev/test pushes).
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
@@ -9,12 +15,87 @@ permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/luxfi/aml
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
uses: hanzoai/.github/.github/workflows/docker-build.yml@main
|
||||
with:
|
||||
image: ghcr.io/luxfi/aml
|
||||
# Native multi-arch on lux-org ARC scale-sets — no QEMU.
|
||||
runner-amd64: lux-build-linux-amd64
|
||||
runner-arm64: lux-build-linux-arm64
|
||||
runner-deploy: lux-build-linux-amd64
|
||||
build:
|
||||
name: Build ${{ matrix.arch }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
runner: lux-build-linux-amd64
|
||||
- arch: arm64
|
||||
runner: lux-build-linux-arm64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build & push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-${{ matrix.arch }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
manifest:
|
||||
needs: build
|
||||
runs-on: lux-build-linux-amd64
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: digests-*
|
||||
path: /tmp/digests
|
||||
merge-multiple: true
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Compute tags
|
||||
id: meta
|
||||
run: |
|
||||
set -e
|
||||
tags=""
|
||||
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
||||
v="${GITHUB_REF#refs/tags/}"
|
||||
tags="-t ${IMAGE}:${v} -t ${IMAGE}:latest"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then
|
||||
tags="-t ${IMAGE}:main"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/dev ]]; then
|
||||
tags="-t ${IMAGE}:dev"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/test ]]; then
|
||||
tags="-t ${IMAGE}:test"
|
||||
fi
|
||||
echo "tags=${tags}" >> "$GITHUB_OUTPUT"
|
||||
- name: Create + push multi-arch manifest
|
||||
if: steps.meta.outputs.tags != ''
|
||||
working-directory: /tmp/digests
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
digests=$(printf "${IMAGE}@sha256:%s " *)
|
||||
docker buildx imagetools create ${{ steps.meta.outputs.tags }} ${digests}
|
||||
- name: Inspect tagged manifest
|
||||
if: github.ref_type == 'tag'
|
||||
run: docker buildx imagetools inspect ${IMAGE}:${GITHUB_REF#refs/tags/}
|
||||
|
||||
Reference in New Issue
Block a user