From 9a921b3d706fb10d91aa40440e84399582f4cf60 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Sun, 26 Sep 2021 16:23:33 +0000 Subject: [PATCH] Fix setting image during build --- .github/workflows/builder.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index ea6e81b..87539a8 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -62,7 +62,7 @@ jobs: if: needs.init.outputs.changed == 'true' name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on strategy: - matrix: + matrix: addon: ${{ fromJson(needs.init.outputs.changed_addons) }} arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] @@ -79,15 +79,16 @@ jobs: - name: Check if add-on should be built id: check run: | - if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then - echo "::set-output name=build_arch::true"; - if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then - echo "BUILD_ARGS=" >> $GITHUB_ENV; - fi - else - echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build"; - echo "::set-output name=build_arch::false"; - fi + if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then + echo "::set-output name=build_arch::true"; + echo "::set-output name=image::$(echo '${{ steps.info.outputs.image }}' | cut -d'/' -f3)"; + if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then + echo "BUILD_ARGS=" >> $GITHUB_ENV; + fi + else + echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build"; + echo "::set-output name=build_arch::false"; + fi - name: Login to GitHub Container Registry if: env.BUILD_ARGS != '--test' @@ -105,6 +106,6 @@ jobs: ${{ env.BUILD_ARGS }} \ --${{ matrix.arch }} \ --target /data/${{ matrix.addon }} \ - --image "$(echo '${{ steps.info.outputs.image }}' | cut -d'/' -f3)" \ + --image "${{ steps.check.outputs.image }}" \ --docker-hub "ghcr.io/${{ github.repository_owner }}" \ --addon