From 51101ca37449f58afcb9a8bafb006ef6414973b5 Mon Sep 17 00:00:00 2001 From: Fedor Dikarev Date: Mon, 30 Sep 2024 15:45:21 +0200 Subject: [PATCH] use metadata-action for docker tags --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1bd155..34c6bae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,17 @@ jobs: docker: runs-on: ubuntu-latest steps: + - name: Docker Meta + id: meta + uses: docker/metadata-action@v6 + with: + images: + ${{ vars.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} + tags: | + # branch event + type=ref,enable=true,priority=600,prefix=,suffix=,event=branch + # pull request event + type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -34,4 +45,6 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64, linux/arm64 - push: true + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}