91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
name: Reusable Docker Build Workflow
|
|
|
|
on:
|
|
workflow_dispatch: # Prevents phantom runs on push, allows manual testing
|
|
workflow_call:
|
|
inputs:
|
|
image_name:
|
|
description: "Name of the Docker image (e.g. cua-ubuntu, cua-xfce)"
|
|
required: true
|
|
type: string
|
|
context_dir:
|
|
description: "Directory containing the Dockerfile relative to workspace root (e.g. libs/kasm, libs/xfce)"
|
|
required: true
|
|
type: string
|
|
dockerfile_path:
|
|
description: "Path to Dockerfile relative to context_dir (e.g. Dockerfile)"
|
|
required: false
|
|
type: string
|
|
default: "Dockerfile"
|
|
skip_arm64:
|
|
description: "Skip arm64 build (for images that don't support arm64)"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
platforms: ${{ steps.set-platforms.outputs.platforms }}
|
|
steps:
|
|
- id: set-platforms
|
|
run: |
|
|
if [ "${{ inputs.skip_arm64 }}" == "true" ]; then
|
|
echo 'platforms=["linux/amd64"]' >> $GITHUB_OUTPUT
|
|
else
|
|
echo 'platforms=["linux/amd64", "linux/arm64"]' >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
build:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: ${{ fromJSON(needs.setup.outputs.platforms) }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare platform tag
|
|
id: platform
|
|
run: |
|
|
TAG=$(echo "${{ matrix.platform }}" | sed 's/\//-/g')
|
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./${{ inputs.context_dir }}
|
|
file: ./${{ inputs.context_dir }}/${{ inputs.dockerfile_path }}
|
|
push: false
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
- name: Verify build
|
|
run: |
|
|
echo "Successfully built ${{ inputs.image_name }} for ${{ matrix.platform }}"
|