From 5aa1f28f8f45cc340af332364da26ec9b78cc29a Mon Sep 17 00:00:00 2001 From: Curtis Ruck Date: Fri, 26 Aug 2022 10:14:01 -0400 Subject: [PATCH] Update publish.yaml --- .github/workflows/publish.yaml | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9f6b451..f3e37ae 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,7 +11,7 @@ env: IMAGE_NAME: ${{ github.actor }}/goproxygo jobs: - build-and-push-image: + build-and-push: runs-on: ubuntu-latest permissions: contents: read @@ -21,37 +21,40 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64,amd64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log in to the Container registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Setup QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64,amd64 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} type=ref,event=branch - type=sha + type=ref,event=pr + type=semver,pattern=version + type=semver,pattern={{major}}.{{minor}} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/arm64,linux/amd64 + cache-from: type=gha + cache-to: type=gha,mode=max