From 554f9ba32e73ab40d8f2a4f7b2a09e8d8f59e46b Mon Sep 17 00:00:00 2001 From: haider Date: Wed, 1 May 2024 12:28:12 +0100 Subject: [PATCH] Update docker tag logic --- .github/workflows/docker.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 31a054ff..328dea92 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -36,5 +36,10 @@ jobs: - name: Build and push zooma Docker image run: | docker build -t ghcr.io/ebispot/zooma:${{ github.sha }} . - docker tag ghcr.io/ebispot/zooma:${{ github.sha }} ghcr.io/ebispot/zooma:${{ github.ref_name }} + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + TAG="PR-${{ github.event.pull_request.number }}" + else + TAG="${{ github.ref_name }}" + fi + docker tag ghcr.io/ebispot/zooma:${{ github.sha }} ghcr.io/ebispot/zooma:${TAG} docker push --all-tags ghcr.io/ebispot/zooma