Skip to content

Commit 0d7725f

Browse files
committed
Refactor tag handling in container build step to create Docker tag arguments
1 parent c462a3f commit 0d7725f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/container-build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,21 @@ jobs:
4343
type=semver,pattern={{version}}
4444
type=semver,pattern={{major}}.{{minor}}
4545
type=semver,pattern={{major}}
46-
type=sha
47-
46+
type=sha
47+
4848
- name: Build and push container
4949
run: |
50-
# Convert comma-separated tags to semicolon-separated for .NET SDK
51-
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr ',' ';')
50+
# Create tag arguments for Docker
51+
TAGS=""
52+
while IFS= read -r tag; do
53+
TAGS="$TAGS -t $tag"
54+
done <<< "${{ steps.meta.outputs.tags }}"
55+
5256
dotnet publish Web/Web.csproj \
5357
--os linux \
5458
--arch x64 \
5559
-c Release \
5660
--self-contained \
5761
/p:PublishProfile=DefaultContainer \
5862
/p:ContainerRepository=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
59-
/p:ContainerImageTags="$TAGS"
63+
/p:ContainerBuildArgs="$TAGS"

0 commit comments

Comments
 (0)