From d5b45580a29432a72e5f9643f0deb469175b6868 Mon Sep 17 00:00:00 2001 From: Andreas Grimmer Date: Mon, 11 Nov 2024 12:59:12 +0100 Subject: [PATCH] Update CI.yml --- .github/workflows/CI.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 }}