From 62c3f100a774e36d8e1f70a55a795120bfcbd74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 24 May 2024 03:47:55 -0300 Subject: [PATCH] test --- .github/workflows/deploy.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc05117..6214539 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,7 @@ env: DOCKER: base DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} IMAGE_LIMIT_SIZE_MB: 600 + ARTIFACTS_PATH: /tmp/artifacts on: workflow_dispatch: @@ -36,6 +37,11 @@ jobs: echo "DOCKER_IMAGE=${DOCKER_USERNAME:-bluerobotics}/${PROJECT}-${DOCKER}" >> $GITHUB_ENV + mkdir -p "${ARTIFACTS_PATH}" + digest_path="${ARTIFACTS_PATH}/digests" + mkdir -p "${digest_path}" + echo "DIGESTS_PATH=${digest_path}" >> $GITHUB_ENV + platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV @@ -96,7 +102,7 @@ jobs: platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} push: ${{ github.event_name != 'pull_request' }} - outputs: type=docker,name=${{ env.DOCKER_IMAGE }},name-canonical=true + outputs: type=docker,dest=${{ env.ARTIFACTS_PATH }}/${{ env.PLATFORM_PAIR }}.tar build-args: ${{ steps.prepare.outputs.buildx_args }} tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha @@ -116,15 +122,22 @@ jobs: - name: Export digest run: | - mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" + touch "${{ env.DIGESTS_PATH }}/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* + path: ${{ env.DIGESTS_PATH }}/* + if-no-files-found: error + retention-days: 1 + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PROJECT }}-${{ env.DOCKER }}-${{ env.PLATFORM_PAIR }} + path: ${{ env.ARTIFACTS_PATH }}/*.tar if-no-files-found: error retention-days: 1 @@ -136,7 +149,7 @@ jobs: - name: Download digests uses: actions/download-artifact@v4 with: - path: /tmp/digests + path: ${{ env.DIGESTS_PATH }} pattern: digests-* merge-multiple: true @@ -161,7 +174,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Create manifest list and push - working-directory: /tmp/digests + working-directory: ${{ env.DIGESTS_PATH }} run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.DOCKER_IMAGE }}@sha256:%s ' *)