From edbf95457578cd8be4b76ecd58b634650e4b2203 Mon Sep 17 00:00:00 2001 From: Wittawas Nakkasem Date: Sat, 25 May 2024 01:39:52 +0700 Subject: [PATCH] chore: use docker/metadata-action --- .github/workflows/radio-container.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/radio-container.yml b/.github/workflows/radio-container.yml index f1e0ed98..4e323b50 100644 --- a/.github/workflows/radio-container.yml +++ b/.github/workflows/radio-container.yml @@ -23,10 +23,19 @@ jobs: with: submodules: recursive - - name: Get image repository short commit - id: version - run: | - echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_OUTPUT + # - name: Get image repository short commit + # id: version + # run: | + # echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_OUTPUT + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha - name: Log in to the Container registry uses: docker/login-action@v3 @@ -41,4 +50,6 @@ jobs: context: . file: ./packages/radio/docker/discord/Dockerfile push: true - tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.SHORT_SHA }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" + # tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.SHORT_SHA }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}