diff --git a/.github/workflows/build-php.yml b/.github/workflows/build-php.yml index eefcef8..d78b374 100644 --- a/.github/workflows/build-php.yml +++ b/.github/workflows/build-php.yml @@ -43,21 +43,21 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3.1.0 - name: Build and Push by digest (runtime) - uses: Ilyes512/github-actions/build-target@1.0.9 + uses: Ilyes512/github-actions/build-target@1.0.10 with: platform: ${{ inputs.platform }} image-name: ${{ steps.image_name.outputs.lowercase }} dockerfile: ${{ inputs.dockerfile }} target: runtime - name: Build and Push by digest (builder) - uses: Ilyes512/github-actions/build-target@1.0.9 + uses: Ilyes512/github-actions/build-target@1.0.10 with: platform: ${{ inputs.platform }} image-name: ${{ steps.image_name.outputs.lowercase }} dockerfile: ${{ inputs.dockerfile }} target: builder - name: Build and Push by digest (builder_nodejs) - uses: Ilyes512/github-actions/build-target@1.0.9 + uses: Ilyes512/github-actions/build-target@1.0.10 with: platform: ${{ inputs.platform }} image-name: ${{ steps.image_name.outputs.lowercase }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d78b7ed..1b178dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,14 @@ on: description: Dockerfile path type: string default: Dockerfile + title: + description: Custom image title (overrides repository name) + type: string + required: false + description: + description: Custom image description (overrides repository description) + type: string + required: false jobs: build: @@ -42,8 +50,10 @@ jobs: with: string: ${{ inputs.image-name }} - name: Build and Push by digest - uses: Ilyes512/github-actions/build-image@1.0.9 + uses: Ilyes512/github-actions/build-image@1.0.10 with: dockerfile: ${{ inputs.dockerfile }} platform: ${{ inputs.platform }} image-name: ${{ steps.image_name.outputs.lowercase }} + title: ${{ inputs.title }} + description: ${{ inputs.description }} diff --git a/.github/workflows/merge-php.yml b/.github/workflows/merge-php.yml index 6be2ac7..fff93a8 100644 --- a/.github/workflows/merge-php.yml +++ b/.github/workflows/merge-php.yml @@ -59,21 +59,21 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Create Manifest (runtime) - uses: Ilyes512/github-actions/create-manifest-for-target@1.0.9 + uses: Ilyes512/github-actions/create-manifest-for-target@1.0.10 with: image-name: ${{ steps.image_name.outputs.lowercase }} target: runtime description: ${{ inputs.description-runtime }} title: ${{ inputs.title-runtime }} - name: Create Manifest (builder) - uses: Ilyes512/github-actions/create-manifest-for-target@1.0.9 + uses: Ilyes512/github-actions/create-manifest-for-target@1.0.10 with: image-name: ${{ steps.image_name.outputs.lowercase }} target: builder description: ${{ inputs.description-builder }} title: ${{ inputs.title-builder }} - name: Create Manifest (builder_nodejs) - uses: Ilyes512/github-actions/create-manifest-for-target@1.0.9 + uses: Ilyes512/github-actions/create-manifest-for-target@1.0.10 with: image-name: ${{ steps.image_name.outputs.lowercase }} target: builder_nodejs diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 0099d83..e3612be 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -42,7 +42,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Create Manifest - uses: Ilyes512/github-actions/create-manifest@1.0.9 + uses: Ilyes512/github-actions/create-manifest@1.0.10 with: image-name: ${{ steps.image_name.outputs.lowercase }} title: ${{ inputs.title }} diff --git a/create-manifest-for-target/action.yml b/create-manifest-for-target/action.yml index 1feeda4..7006400 100644 --- a/create-manifest-for-target/action.yml +++ b/create-manifest-for-target/action.yml @@ -64,10 +64,19 @@ runs: working-directory: ${{ runner.temp }}/digests/${{ env.SAFE_IMAGE_NAME }}/${{ inputs.target }} shell: bash run: | + echo "DEBUG: DOCKER_METADATA_OUTPUT_JSON labels:" + jq '.labels' <<< "$DOCKER_METADATA_OUTPUT_JSON" + mapfile -t tags < <(jq -r '.tags[] | "-t\n" + .' <<< "$DOCKER_METADATA_OUTPUT_JSON") - mapfile -t annotations < <(jq -r '.labels | to_entries[] | "--annotation\nindex:" + .key + "=" + .value + "\n--annotation\nmanifest:" + .key + "=" + .value' <<< "$DOCKER_METADATA_OUTPUT_JSON") + mapfile -t annotations < <(jq -r ' + .labels | to_entries[] | select(.value != "") | + "--annotation\nindex:" + .key + "=" + .value + "\n--annotation\nmanifest-descriptor:" + .key + "=" + .value + ' <<< "$DOCKER_METADATA_OUTPUT_JSON") images=$(printf '${{ inputs.image-name }}@sha256:%s ' *) + echo "DEBUG: annotations array:" + printf '%s\n' "${annotations[@]}" + docker buildx imagetools create "${tags[@]}" "${annotations[@]}" $images - name: Inspect image shell: bash diff --git a/create-manifest/action.yml b/create-manifest/action.yml index 659dadc..647d8b4 100644 --- a/create-manifest/action.yml +++ b/create-manifest/action.yml @@ -54,10 +54,19 @@ runs: working-directory: ${{ runner.temp }}/digests shell: bash run: | + echo "DEBUG: DOCKER_METADATA_OUTPUT_JSON labels:" + jq '.labels' <<< "$DOCKER_METADATA_OUTPUT_JSON" + mapfile -t tags < <(jq -r '.tags[] | "-t\n" + .' <<< "$DOCKER_METADATA_OUTPUT_JSON") - mapfile -t annotations < <(jq -r '.labels | to_entries[] | "--annotation\nindex:" + .key + "=" + .value + "\n--annotation\nmanifest:" + .key + "=" + .value' <<< "$DOCKER_METADATA_OUTPUT_JSON") + mapfile -t annotations < <(jq -r ' + .labels | to_entries[] | select(.value != "") | + "--annotation\nindex:" + .key + "=" + .value + "\n--annotation\nmanifest-descriptor:" + .key + "=" + .value + ' <<< "$DOCKER_METADATA_OUTPUT_JSON") images=$(printf '${{ inputs.image-name }}@sha256:%s ' *) + echo "DEBUG: annotations array:" + printf '%s\n' "${annotations[@]}" + docker buildx imagetools create "${tags[@]}" "${annotations[@]}" $images - name: Inspect image shell: bash