diff --git a/.github/workflows/docker-build-push-multi-platform.yml b/.github/workflows/docker-build-push-multi-platform.yml deleted file mode 100644 index a1663fc..0000000 --- a/.github/workflows/docker-build-push-multi-platform.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: docker-build-push - -on: - workflow_call: - inputs: - registry-image: - description: >- - Docker image to use as base name for tags. - required: true - type: string - metadata-tags: - description: >- - List of tags as key-value pair attributes. - required: false - type: string - registry-address: - description: >- - Server address of Docker registry. If not set then will default to Docker registry. - required: false - type: string - default: docker.io - registry-username: - description: >- - Username for authenticating to the Docker registry. - required: true - type: string - build-context: - description: >- - Build's context is the set of files located in the specified PATH or URL. - type: string - required: false - build-file: - description: >- - Path to the Dockerfile. - type: string - required: false - build-provenance: - description: >- - Generate provenance attestation for the build. - required: false - type: boolean - default: false - build-cache-key: - description: >- - An explicit key for a cache entry. - required: false - type: string - default: coatl - build-digest-key: - description: >- - Name of the build digest. - required: false - type: string - default: coatl - secrets: - registry-password: - description: >- - Password or personal access token for authenticating the Docker registry. - required: true - -jobs: - build: - runs-on: ${{ matrix.builder.runner-image }} - strategy: - fail-fast: false - matrix: - builder: - - runner-image: ubuntu-latest - platform: linux/amd64 - - runner-image: blacksmith-arm - platform: linux/arm64 - steps: - - name: Prepare - run: | - platform=${{ matrix.builder.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ inputs.registry-image }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker registry - uses: docker/login-action@v3 - with: - registry: ${{ inputs.registry-address }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Build and push by digest - id: build - uses: docker/build-push-action@v6 - with: - cache-from: type=gha,scope=${{ inputs.build-cache-key }}-${{ env.PLATFORM_PAIR }} - cache-to: type=gha,scope=${{ inputs.build-cache-key }}-${{ env.PLATFORM_PAIR }},mode=max - context: ${{ inputs.build-context }} - file: ${{ inputs.build-file }} - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ inputs.registry-image }},push-by-digest=true,name-canonical=true,push=true - platforms: ${{ matrix.builder.platform }} - provenance: ${{ inputs.build-provenance }} - - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ inputs.build-digest-key }}-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-${{ inputs.build-digest-key }}-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ inputs.registry-image }} - tags: | - ${{ inputs.metadata-tags }} - - - name: Login to Docker registry - uses: docker/login-action@v3 - with: - registry: ${{ inputs.registry-address }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ inputs.registry-image }}@sha256:%s ' *) - - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ inputs.registry-image }}:${{ steps.meta.outputs.version }}