Skip to content

Commit

Permalink
Update publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ruckc authored Aug 26, 2022
1 parent a7e1f37 commit 5aa1f28
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 5aa1f28

Please sign in to comment.