diff --git a/.github/workflows/build-image-debian.yaml b/.github/workflows/build-image-debian.yaml index 2414cb2..65e66ba 100644 --- a/.github/workflows/build-image-debian.yaml +++ b/.github/workflows/build-image-debian.yaml @@ -15,17 +15,18 @@ env: jobs: build: - runs-on: ${{ startsWith(matrix.platforms, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} strategy: fail-fast: false matrix: - platform: ["linux/amd64", "linux/arm64"] + platform: + - linux/amd64 + - linux/arm64 steps: - name: Checkout uses: actions/checkout@v5 - name: Prepare - id: prep run: | platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV @@ -41,19 +42,20 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 - - name: Build - id: docker_build + - name: Build and push by digest + id: build uses: docker/build-push-action@v6 with: context: debian - load: true - tags: ${{ env.REGISTRY_IMAGE }}:test - outputs: type=image,push-by-digest=true,name-canonical=true + platforms: ${{ matrix.platform }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ env.REGISTRY_IMAGE }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true cache-from: type=gha cache-to: type=gha,mode=max @@ -97,18 +99,9 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - name: Create manifest list (--dry-run) + - name: Create manifest list and push (--dry-run) working-directory: ${{ runner.temp }}/digests run: | docker buildx imagetools create --dry-run $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}