From b7c02a59230986d17042a8eeb019f9a5436a99e3 Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sat, 18 May 2024 23:09:21 +0800 Subject: [PATCH] ci: fix docker --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3275679a..b6b996abe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -416,6 +416,18 @@ jobs: with: version: latest + - name: Set Docker tags and labels based on trigger + id: set-meta + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "tags=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "labels=org.opencontainers.image.version=${{ github.event.inputs.version }}" >> $GITHUB_ENV + else + echo "tags=${{ steps.meta.outputs.tags }}" >> $GITHUB_ENV + echo "labels=${{ steps.meta.outputs.labels }}" >> $GITHUB_ENV + fi + + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata