File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,30 @@ jobs:
4444
4545 - name : Build and push Docker image
4646 id : push
47- uses : docker/build-push-action@v6
48- with :
49- context : .
50- push : true
51- build-args : |
52- WINDOWS_VERSION=ltsc2025
53- VECTOR_VERSION=0.51.0
54- tags : ${{ steps.meta.outputs.tags }}
55- labels : ${{ steps.meta.outputs.labels }}
47+ shell : pwsh
48+ run : |
49+ $imageName = "${{ steps.meta.outputs.tags }}".Split("`n")[0] # Take first tag (usually :latest)
50+ $allTags = "${{ steps.meta.outputs.tags }}".Trim() -split "`n"
51+
52+ # Build the image with your build args
53+ docker build `
54+ --build-arg WINDOWS_VERSION=ltsc2025 `
55+ --build-arg VECTOR_VERSION=0.51.0 `
56+ --label "${{ steps.meta.outputs.labels }}" `
57+ -t $imageName `
58+ ${{ join(' -t ', $allTags) }} `
59+ .
60+
61+ # Push all tags
62+ foreach ($tag in $allTags) {
63+ Write-Host "Pushing $tag"
64+ docker push $tag
65+ }
66+
67+ # Output the same values as build-push-action for compatibility
68+ $tagsJson = ($allTags | ConvertTo-Json -Compress)
69+ $digest = (docker inspect --format='{{index .RepoDigests 0}}' $allTags[0])
70+
71+ echo "tags=$tagsJson" >> $env:GITHUB_OUTPUT
72+ echo "digest=$digest" >> $env:GITHUB_OUTPUT
73+ echo "imageid=$(docker inspect --format='{{.Id}}' $allTags[0])" >> $env:GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments