Fix setting image during build

This commit is contained in:
Ludeeus
2021-09-26 16:23:33 +00:00
parent 57d12e6c17
commit 9a921b3d70

View File

@@ -62,7 +62,7 @@ jobs:
if: needs.init.outputs.changed == 'true' if: needs.init.outputs.changed == 'true'
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
strategy: strategy:
matrix: matrix:
addon: ${{ fromJson(needs.init.outputs.changed_addons) }} addon: ${{ fromJson(needs.init.outputs.changed_addons) }}
arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
@@ -79,15 +79,16 @@ jobs:
- name: Check if add-on should be built - name: Check if add-on should be built
id: check id: check
run: | run: |
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
echo "::set-output name=build_arch::true"; echo "::set-output name=build_arch::true";
if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then echo "::set-output name=image::$(echo '${{ steps.info.outputs.image }}' | cut -d'/' -f3)";
echo "BUILD_ARGS=" >> $GITHUB_ENV; if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
fi echo "BUILD_ARGS=" >> $GITHUB_ENV;
else fi
echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build"; else
echo "::set-output name=build_arch::false"; echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build";
fi echo "::set-output name=build_arch::false";
fi
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
if: env.BUILD_ARGS != '--test' if: env.BUILD_ARGS != '--test'
@@ -105,6 +106,6 @@ jobs:
${{ env.BUILD_ARGS }} \ ${{ env.BUILD_ARGS }} \
--${{ matrix.arch }} \ --${{ matrix.arch }} \
--target /data/${{ matrix.addon }} \ --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 }}" \ --docker-hub "ghcr.io/${{ github.repository_owner }}" \
--addon --addon