diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8ae1623..a6310b9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -43,6 +43,13 @@ jobs: run: | go test -v ./... CGO_ENABLED=0 GOARCH=amd64 go build -o demo + + # Declare variables to store branch name and short Git commit SHA + - name: Declare variables + id: vars + shell: bash + run: | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT # Build a Docker image based on the provided Dockerfile - name: Build and push @@ -51,4 +58,4 @@ jobs: with: context: . push: true - tags: agrimmer/app:latest + tags: agrimmer/app:${{ steps.vars.outputs.sha_short }}