Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed May 24, 2024
1 parent 0242004 commit 62c3f10
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ env:
DOCKER: base
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
IMAGE_LIMIT_SIZE_MB: 600
ARTIFACTS_PATH: /tmp/artifacts

on:
workflow_dispatch:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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 ' *)
Expand Down

0 comments on commit 62c3f10

Please sign in to comment.