Files
amd-strix-halo-toolboxes/.github/workflows/build_and_publish.yml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 24: did not find expected key
2025-08-06 09:18:31 +01:00

69 lines
2.1 KiB
YAML

name: Build & Push AMD Strix Halo Toolboxes
on:
workflow_dispatch:
inputs:
backends:
description: |
Comma-separated list of backends to build (e.g. "rocm-7beta,rocm-7rc").
Use "all" to build everything.
required: false
default: all
env:
DOCKERHUB_REPO: docker.io/kyuz0/amd-strix-halo-toolboxes
LOCAL_PREFIX: llama
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# if inputs.backends == "all", expand to the full list
# otherwise split the comma list into an array
backend: ${{ fromJSON(
github.event.inputs.backends == 'all'
? '["rocm-6.4.2","rocm-7beta","rocm-7rc","vulkan-amdvlk","vulkan-radv"]'
: format(
'[\"{}\"]',
replace(github.event.inputs.backends, ',', '\",\"')
)
) }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set build timestamp
run: echo "BUILD_TS=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_ENV
- name: Build & push ${{ matrix.backend }}
working-directory: toolboxes
run: |
set -euo pipefail
BACKEND="${{ matrix.backend }}"
DF="Dockerfile.${BACKEND}"
LOCAL_IMAGE="${LOCAL_PREFIX}-${BACKEND}"
BUILD_TAG="${BACKEND}_${BUILD_TS}"
IMMUTABLE_REF="${DOCKERHUB_REPO}:${BUILD_TAG}"
CHANNEL_REF="${DOCKERHUB_REPO}:${BACKEND}"
echo "→ Building ${DF}"
docker build --no-cache -t "${LOCAL_IMAGE}" -f "${DF}" .
echo "→ Tag & push immutable → ${IMMUTABLE_REF}"
docker tag "${LOCAL_IMAGE}" "${IMMUTABLE_REF}"
docker push "${IMMUTABLE_REF}"
echo "→ Tag & push channel → ${CHANNEL_REF}"
docker tag "${IMMUTABLE_REF}" "${CHANNEL_REF}"
docker push "${CHANNEL_REF}"