From dca84d8808a2d9a9a1c8138b7861aa121f059994 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Wed, 2 Oct 2024 14:42:48 -0400 Subject: [PATCH 1/4] add some debug info --- .github/actions/build-image/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-image/action.yaml b/.github/actions/build-image/action.yaml index ec7c1cbb..30869fca 100644 --- a/.github/actions/build-image/action.yaml +++ b/.github/actions/build-image/action.yaml @@ -40,10 +40,12 @@ runs: - name: Build and push the Docker image shell: bash + env: + ACTIONS_STEP_DEBUG: "true" run: >- ./earthly.sh --push +docker-multiarch - ${{ inputs.tag_latest != 'false' && format('--LATEST_IMAGE_NAME=ghcr.io/{0}:latest', github.repository) || '' }} + ${{ inputs.tag_latest != 'false' && format('--LATEST_IMAGE_NAME=ghcr.io/{0}:latest', github.repository) || '' }} --GIT_TAG=${{ inputs.image_tag }} --IMAGE_NAME=ghcr.io/${{ github.repository }}:${{ inputs.image_tag }} From 034ea81b21b87b9a65da6028e048903d38efcda3 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Wed, 2 Oct 2024 15:35:44 -0400 Subject: [PATCH 2/4] upgrade some packages --- .github/actions/build-image/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-image/action.yaml b/.github/actions/build-image/action.yaml index 30869fca..74dd20f7 100644 --- a/.github/actions/build-image/action.yaml +++ b/.github/actions/build-image/action.yaml @@ -21,7 +21,7 @@ runs: using: composite steps: - - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-qemu-action@v3 with: image: tonistiigi/binfmt:latest platforms: all @@ -32,7 +32,7 @@ runs: with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" } - name: login to registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} From 394019bdcd5d0eac35758c3a436170ec58e9d6b2 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Wed, 2 Oct 2024 20:14:30 -0400 Subject: [PATCH 3/4] fix CI! --- .github/actions/build-image/action.yaml | 6 +++++- .github/workflows/on_pull_request.yaml | 2 ++ .github/workflows/on_push_to_main.yaml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-image/action.yaml b/.github/actions/build-image/action.yaml index 74dd20f7..83aa66dd 100644 --- a/.github/actions/build-image/action.yaml +++ b/.github/actions/build-image/action.yaml @@ -5,6 +5,10 @@ inputs: image_tag: description: The image tag required: true + push: + description: True to push image after building, false otherwise + required: false + default: "false" tag_latest: description: Tag latest as well as the provided tag default: "false" @@ -44,7 +48,7 @@ runs: ACTIONS_STEP_DEBUG: "true" run: >- ./earthly.sh - --push + ${{ inputs.push == 'true' && '--push' || '' }} +docker-multiarch ${{ inputs.tag_latest != 'false' && format('--LATEST_IMAGE_NAME=ghcr.io/{0}:latest', github.repository) || '' }} --GIT_TAG=${{ inputs.image_tag }} diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 4cc4e68d..fa828f6f 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -32,6 +32,7 @@ jobs: - uses: ./.github/actions/build-image id: build-image with: + push: '${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}' image_tag: ${{ env.FS_TAG }} token: ${{ secrets.GITHUB_TOKEN }} @@ -39,3 +40,4 @@ jobs: with: message: | Temporary image available at `${{ steps.build-image.outputs.image }}`. + if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name diff --git a/.github/workflows/on_push_to_main.yaml b/.github/workflows/on_push_to_main.yaml index c3a9ac13..5ecb85f3 100644 --- a/.github/workflows/on_push_to_main.yaml +++ b/.github/workflows/on_push_to_main.yaml @@ -23,6 +23,7 @@ jobs: - uses: ./.github/actions/build-image with: + push: 'true' image_tag: ${{ env.GIT_TAG }} token: ${{ secrets.GITHUB_TOKEN }} From 93e985332f81da80e0d5894705fd58f1c2e9ce53 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Wed, 2 Oct 2024 20:44:34 -0400 Subject: [PATCH 4/4] remove debug step --- .github/actions/build-image/action.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/build-image/action.yaml b/.github/actions/build-image/action.yaml index 83aa66dd..5a426ee1 100644 --- a/.github/actions/build-image/action.yaml +++ b/.github/actions/build-image/action.yaml @@ -44,8 +44,6 @@ runs: - name: Build and push the Docker image shell: bash - env: - ACTIONS_STEP_DEBUG: "true" run: >- ./earthly.sh ${{ inputs.push == 'true' && '--push' || '' }}