From 7805788578f2846a43c6dd3a5ef64bb12d58c31c Mon Sep 17 00:00:00 2001 From: Dobry-kot Date: Fri, 3 May 2024 19:34:58 +0300 Subject: [PATCH] [feature-swarm-docker-build] fix sha --- .github/workflows/build-for-test.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-for-test.yml b/.github/workflows/build-for-test.yml index 04d6c772..ef9617ac 100644 --- a/.github/workflows/build-for-test.yml +++ b/.github/workflows/build-for-test.yml @@ -10,7 +10,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + + - uses: benjlevesque/short-sha@v3.0 + id: short-sha + with: + length: 8 + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -26,7 +31,7 @@ jobs: context: . file: ./Dockerfile.goose push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.goose:${{ github.head_ref || github.ref_name }}-${{ github.sha:0:8 }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.goose:${{ github.head_ref || github.ref_name }}-${{ steps.short-sha.outputs.sha }} - name: Build and push sgroups uses: docker/build-push-action@v5 @@ -34,7 +39,7 @@ jobs: context: . file: ./Dockerfile.sgroups push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups:${{ github.head_ref || github.ref_name }}-${{ github.sha:0:8 }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups:${{ github.head_ref || github.ref_name }}-${{ steps.short-sha.outputs.sha }} - name: Build and push terraform uses: docker/build-push-action@v5 @@ -42,7 +47,7 @@ jobs: context: . file: ./Dockerfile.terraform push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.terraform:${{ github.head_ref || github.ref_name }}-${{ github.sha:0:8 }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.terraform:${{ github.head_ref || github.ref_name }}-${{ steps.short-sha.outputs.sha }} - name: Build and push to-nft uses: docker/build-push-action@v5 @@ -50,4 +55,4 @@ jobs: context: . file: ./Dockerfile.to-nft push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.to-nft:${{ github.head_ref || github.ref_name }}-${{ github.sha:0:8 }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sgroups.to-nft:${{ github.head_ref || github.ref_name }}-${{ steps.short-sha.outputs.sha }}