Skip to content

Commit 2736cbd

Browse files
authored
How about this
1 parent 2ffa2ca commit 2736cbd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/docker-image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
- name: Run tests
2121
run: dotnet test
2222

23+
24+
- name: Get Short SHA
25+
id: get_short_sha
26+
run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
27+
2328
- name: Build & push container to Docker Hub
2429
env:
2530
# set these in your repo secrets
@@ -29,5 +34,5 @@ jobs:
2934
dotnet publish -c Release \
3035
-p:ContainerRegistry=docker.io \
3136
-p:ContainerRepository=nihlen/bf2-webadmin \
32-
-p:ContainerImageTags="latest,sha-${{ substring(github.sha, 0, 8) }}" \
37+
-p:ContainerImageTags="latest,sha-$SHORT_SHA" \
3338
-p:ContainerPush=true

0 commit comments

Comments
 (0)