diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9d3ec05a..3ac05526 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -132,7 +132,8 @@ jobs: # Get all the published targets of the bake group TARGETS=$(docker buildx bake php${PHP_VERSION//.} --progress=quiet --print | jq -r '.target | to_entries[] | select(.value.tags) | .key') - for TARGET in $TARGETS; do + publish() { + TARGET="$1" TAG_ORI=$(REPO="ghcr.io/${{ github.repository_owner }}/php" TAG_PREFIX="rc${GITHUB_RUN_ID}-" docker buildx bake ${TARGET} --progress=quiet --print | jq -r ".target | to_entries[] | select(.key == \"${TARGET}\") | .value.tags[0]") TAG_PATH=$(REPO="php" IS_RELEASE="1" PHP_PATCH_MINOR="${{ env.PHP_PATCH_MINOR }}" docker buildx bake ${TARGET} --progress=quiet --print | jq -r ".target | to_entries[] | select(.key == \"${TARGET}\") | .value.tags[1]") TAG_MINOR=$(REPO="php" docker buildx bake ${TARGET} --progress=quiet --print | jq -r ".target | to_entries[] | select(.key == \"${TARGET}\") | .value.tags[0]") @@ -153,4 +154,7 @@ jobs: # Create manifest for PHP_VERSION regctl image copy "${TAG_ORI}" "thecodingmachine/${TAG_MINOR}" fi - done + } + export -f publish + # 4 targets at the same time + printf '%s\n' $TARGETS | xargs -P 4 -I {} bash -ec 'publish {}'