From 604bccf0678f4ca6ddf709ebe11f00fa23850187 Mon Sep 17 00:00:00 2001 From: ngutech21 Date: Thu, 18 Jan 2024 10:02:22 +0100 Subject: [PATCH] chore: use short commithash in ghaction --- .github/workflows/dockerhub.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index ac786023..98be2f84 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -24,13 +24,17 @@ jobs: id: date run: echo "::set-output name=date::$(date -u '+%F-%T')" + - name: Get short SHA + id: sha + run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" + - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . push: true build-args: | - COMMITHASH=${{ github.sha }} + COMMITHASH=${{ steps.date.outputs.sha }} BUILDTIME=${{ steps.date.outputs.date }} - tags: docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:latest + tags: docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:latest, docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:${{ steps.date.outputs.sha }}