mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
One label per runner, spelled <os>-<arch>. The aliases these jobs named were removed, and a job naming a label no runner carries waits instead of failing. Co-authored-by: Hanzo Dev <[email protected]>
69 lines
2.5 KiB
YAML
69 lines
2.5 KiB
YAML
name: Docker
|
|
|
|
# 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:
|
|
push:
|
|
branches: [main, dev, test]
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
IMAGE: ghcr.io/luxfi/broker
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [linux-amd64]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
# ghcr.io, from a self-hosted runner. `secrets.GITHUB_TOKEN` is minted by
|
|
# git.hanzo.ai and ghcr.io has never seen it, so the login answered
|
|
# denied: denied
|
|
# and every job after it skipped. On GitHub that pair is correct and this
|
|
# file was written for GitHub; every job here runs on a lux self-hosted
|
|
# pool, so GitHub is not the executor and its token is not a credential.
|
|
# orgs/luxfi provisions exactly GHCR_USER + GHCR_TOKEN — no GH_PAT, and a
|
|
# missing org secret is "", so a `||` chain would hide which one was used.
|
|
username: ${{ secrets.GHCR_USER }}
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
|
- name: Compute tags
|
|
id: meta
|
|
run: |
|
|
set -e
|
|
tags=""
|
|
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
|
v="${GITHUB_REF#refs/tags/}"
|
|
tags="ghcr.io/luxfi/broker:${v},ghcr.io/luxfi/broker:latest"
|
|
elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then
|
|
tags="ghcr.io/luxfi/broker:main"
|
|
elif [[ "${GITHUB_REF}" == refs/heads/dev ]]; then
|
|
tags="ghcr.io/luxfi/broker:dev"
|
|
elif [[ "${GITHUB_REF}" == refs/heads/test ]]; then
|
|
tags="ghcr.io/luxfi/broker:test"
|
|
fi
|
|
echo "tags=${tags}" >> "$GITHUB_OUTPUT"
|
|
- name: Build & push
|
|
if: steps.meta.outputs.tags != ''
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
# The Dockerfile mounts this as id=gh_token to fetch private hanzoai/*
|
|
# modules. GHCR_TOKEN is the only GitHub credential orgs/luxfi provisions
|
|
# and must be a real PAT for ghcr.io to accept it, so it can read them.
|
|
secrets: |
|
|
gh_token=${{ secrets.GHCR_TOKEN }} |