Skip to content

Commit

Permalink
Append COMMIT_SHORT_SHA to container image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXKnight committed Aug 25, 2024
1 parent 0c292c0 commit 4818012
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ jobs:
username: "${{ secrets.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"

- name: Set Short Git Commit SHA
id: vars
run: |
SHORT_SHA=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$SHORT_SHA" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: "${{ secrets.DOCKER_HUB_USERNAME }}/telegraf:1.31.3"
tags: "${{ secrets.DOCKER_HUB_USERNAME }}/telegraf:1.31.3-${{ env.COMMIT_SHORT_SHA }}"

0 comments on commit 4818012

Please sign in to comment.