From ba9b34c39689ea084dac8420fded4cf297f2092d Mon Sep 17 00:00:00 2001 From: Michele Catalano Date: Mon, 1 Nov 2021 14:11:00 +0100 Subject: [PATCH] use short sha version --- .github/workflows/ci.yaml | 5 ++++- .github/workflows/release.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0db64c0..b5fb740 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,12 +55,15 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: define short sha + id: short_sha + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: push: ${{ 'refs/heads/main' == github.ref }} - tags: "ironpinguin/terraform_http_backend:${{ github.sha }}" + tags: "ironpinguin/terraform_http_backend:${{ steps.short_sha.outputs.sha_short }}" coverage: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 35ba7f6..084da09 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,9 +47,12 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: define short sha + id: short_sha + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Build and push id: docker_build_push uses: docker/build-push-action@v2 with: push: true - tags: "ironpinguin/terraform_http_backend:${{ github.sha }},ironpinguin/terraform_http_backend:${{ steps.get_version.outputs.VERSION }}" + tags: "ironpinguin/terraform_http_backend:${{ steps.short_sha.outputs.sha_short }},ironpinguin/terraform_http_backend:${{ steps.get_version.outputs.VERSION }},ironpinguin/terraform_http_backend:latest"