From 3f18d0f6e31d3b48cbce0bf90ec10bf7d7372a12 Mon Sep 17 00:00:00 2001 From: Yohan9206 Date: Sun, 13 Jul 2025 23:29:33 +0300 Subject: [PATCH] fixing taging for dockerBuild --- .github/workflows/dockerBuild.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dockerBuild.yml b/.github/workflows/dockerBuild.yml index 18455c8ddd..95febb2fa5 100644 --- a/.github/workflows/dockerBuild.yml +++ b/.github/workflows/dockerBuild.yml @@ -18,24 +18,23 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Get short commit SHA + id: vars + run: echo "COMMIT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV + - name: Build Docker image run: | docker build -t my_first_container . - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Tag and push image uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Tag and push image + - name: Tag and push Docker image run: | - docker tag my_first_container yohands/my_first_container:latest - docker push yohands/my_first_container:latest - + docker tag my_first_container yohands/my_first_container:latest + docker tag my_first_container yohands/my_first_container:${{ env.COMMIT_SHA }} + docker push yohands/my_first_container:latest + docker push yohands/my_first_container:${{ env.COMMIT_SHA }} \ No newline at end of file