From b8668052f12d7aa0aa83c5ffc257e4409cb6d682 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:58:26 -0500 Subject: [PATCH] ci: set image name by env or label --- .github/workflows/docker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 29d0acdc5..0eabbc4d7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,11 +57,16 @@ jobs: username: ${{ env.REGISTRY_USER }} password: ${{ env.REGISTRY_PASS }} - - name: Extract image name from Dockerfile + - name: Set image name id: image_name run: | - IMAGE=$(grep "LABEL org.opencontainers.image.title" Dockerfile | cut -d'"' -f2) + if [ -n "${{ env.IMAGE }}" ]; then + IMAGE="${{ env.IMAGE }}" + else + IMAGE=$(grep "LABEL org.opencontainers.image.title" Dockerfile | cut -d'"' -f2) + fi echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT + echo "IMAGE=$IMAGE" >> $GITHUB_ENV - name: Docker meta id: meta