Skip to content

Commit

Permalink
use short sha version
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Catalano committed Nov 1, 2021
1 parent a0f477d commit ba9b34c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit ba9b34c

Please sign in to comment.