diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-reusable.yml index 1093314..529ad1b 100644 --- a/.github/workflows/docker-reusable.yml +++ b/.github/workflows/docker-reusable.yml @@ -93,7 +93,12 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.matrix.outputs.matrix }} + build_id: ${{ steps.build_id.outputs.build_id }} steps: + - name: Generate unique build id + id: build_id + run: echo "build_id=$(openssl rand -hex 5)" >> $GITHUB_OUTPUT + - name: Compute matrix id: matrix uses: fabiocaccamo/create-matrix-action@v5 @@ -104,16 +109,16 @@ jobs: # Build platform specific image build: + name: Build ${{ matrix.os }}/${{ matrix.arch }} + runs-on: ${{ matrix.builder }} needs: compute strategy: fail-fast: true matrix: include: ${{ fromJson(needs.compute.outputs.matrix) }} - - name: Build ${{ matrix.os }}/${{ matrix.arch }} - runs-on: ${{ matrix.builder }} env: PLATFORM: ${{ format('{0}/{1}', 'linux', matrix.arch) }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -175,7 +180,7 @@ jobs: - name: Docker - Upload digest uses: actions/upload-artifact@v4 with: - name: digests-${{ matrix.arch }} + name: digests-${{ needs.compute.outputs.build_id }}-${{ matrix.arch }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 @@ -185,7 +190,7 @@ jobs: publish: name: Publish multi-platform image runs-on: ubuntu-latest - needs: build + needs: [build, compute] steps: - name: Docker - Variables run: | @@ -214,7 +219,7 @@ jobs: uses: actions/download-artifact@v4 with: path: /tmp/digests - pattern: digests-* + pattern: digests-${{ needs.compute.outputs.build_id }}-* merge-multiple: true - name: Docker - Set up Buildx