mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
ci(docker): single-arch amd64 on lux-build runner (per-arch pools not online yet)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
name: Docker
|
||||
|
||||
# Native multi-arch container build for ghcr.io/luxfi/broker 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).
|
||||
# Single-arch (linux/amd64) container build on the working `lux-build` ARC label.
|
||||
# Multi-arch (arm64) will return once the per-arch `lux-build-linux-arm64`
|
||||
# pool is verified online (current per-arch labels did not pick up jobs).
|
||||
# No QEMU, no cross-org reusable.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -20,53 +20,10 @@ env:
|
||||
|
||||
jobs:
|
||||
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 }}
|
||||
runs-on: lux-build
|
||||
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
|
||||
@@ -79,23 +36,20 @@ jobs:
|
||||
tags=""
|
||||
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
||||
v="${GITHUB_REF#refs/tags/}"
|
||||
tags="-t ${IMAGE}:${v} -t ${IMAGE}:latest"
|
||||
tags="ghcr.io/luxfi/broker:${v},ghcr.io/luxfi/broker:latest"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then
|
||||
tags="-t ${IMAGE}:main"
|
||||
tags="ghcr.io/luxfi/broker:main"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/dev ]]; then
|
||||
tags="-t ${IMAGE}:dev"
|
||||
tags="ghcr.io/luxfi/broker:dev"
|
||||
elif [[ "${GITHUB_REF}" == refs/heads/test ]]; then
|
||||
tags="-t ${IMAGE}:test"
|
||||
tags="ghcr.io/luxfi/broker:test"
|
||||
fi
|
||||
echo "tags=${tags}" >> "$GITHUB_OUTPUT"
|
||||
- name: Create + push multi-arch manifest
|
||||
- name: Build & push
|
||||
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/}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
Reference in New Issue
Block a user