From 4dcdc0efc9f269371e1b5e882b3b8a24780504e7 Mon Sep 17 00:00:00 2001 From: Formartha Date: Tue, 27 Feb 2024 01:01:20 +0200 Subject: [PATCH] Update docker-image.yml --- .github/workflows/docker-image.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a9345b4..a2d87b6 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,14 +16,18 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Get Git commit SHA + id: git_sha + run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" + - name: Build the Docker image run: | - docker build . --file Dockerfile --tag my-image-name:$(date +%s) + docker build . --file Dockerfile --tag formartha/ai1899:${{ steps.git_sha.outputs.sha }} - name: Log into Docker Hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - name: Push Docker image to Docker Hub run: | - docker tag my-image-name:$(date +%s) formartha/ai1899:latest + docker tag formartha/ai1899:${{ steps.git_sha.outputs.sha }} formartha/ai1899:latest docker push formartha/ai1899:latest