From 0abdf814439609dcf7945000b493ccc481b23126 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Sat, 30 Dec 2023 10:38:15 -0600 Subject: [PATCH] Update docker-image.yml --- .github/workflows/docker-image.yml | 50 +++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 887247c0..f87c47cd 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,13 +13,13 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - build-and-push-image: + build-and-upload-image: permissions: write-all runs-on: ubuntu-latest strategy: fail-fast: false matrix: - platform: + platform: #change platform here and below if changed - linux/amd64 - linux/386 - linux/arm/v5 @@ -49,15 +49,6 @@ jobs: uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker images - uses: docker/build-push-action@v3 - with: - context: . - push: true - platforms: ${{ matrix.platform }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - name: Build Docker images uses: docker/build-push-action@v3 with: @@ -75,3 +66,40 @@ jobs: file: /tmp/image.tar asset_name: ${{ github.ref_name }}-${{ matrix.platform }} tag: ${{ github.ref }} + build-and-push-image: + permissions: write-all + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker images + uses: docker/build-push-action@v3 + with: + context: . + push: true + platforms: linux/amd64,linux/386,linux/arm/v5,linux/arm/v7,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}