Skip to content

Commit

Permalink
ci: handle list of docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-tobi committed Feb 14, 2025
1 parent d560cdd commit b69c060
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
required: true
type: string
default: this-is-tobi/tools
IMAGES:
description: Comma separated list of image to build (leave empty to build all)
required: false
type: string
BUILD_AMD64:
description: Build for amd64
required: true
Expand Down Expand Up @@ -45,7 +49,12 @@ jobs:
- name: Generate matrix for build
id: build-matrix
run: |
echo "BUILD_MATRIX=$(jq -c . < ./ci/matrix.json)" >> $GITHUB_OUTPUT
if [ ! -z "${{ inputs.IMAGES }}" ]; then
JQ_FILTER=$(echo "${{ inputs.IMAGES }}" | jq -R 'split(",")')
echo "BUILD_MATRIX=$(jq -c --argjson images "$JQ_FILTER" '[.[] | select(.name | IN($images[]))]' < ./ci/matrix.json)" >> $GITHUB_OUTPUT
else
echo "BUILD_MATRIX=$(jq -c '.' < ./ci/matrix.json)" >> $GITHUB_OUTPUT
fi
build:
name: Build images
Expand Down

0 comments on commit b69c060

Please sign in to comment.