|
42 | 42 | steps: |
43 | 43 | - name: Checkout |
44 | 44 | uses: actions/checkout@v4 |
45 | | - |
46 | | - - name: Set up Docker |
47 | | - uses: docker/setup-docker-action@v4 |
48 | | - |
49 | | - - name: Set up Docker Buildx |
50 | | - uses: docker/setup-buildx-action@v3 |
51 | 45 |
|
52 | 46 | - name: Login to GitHub Container Registry |
53 | 47 | if: env.IMAGE_PUSH == 'true' |
@@ -104,14 +98,25 @@ jobs: |
104 | 98 | Write-Host "Tags: $tagsString" |
105 | 99 |
|
106 | 100 | - name: Build and push Windows container |
107 | | - uses: docker/build-push-action@v6 |
108 | | - with: |
109 | | - context: . |
110 | | - file: Dockerfile.windows |
111 | | - build-args: | |
112 | | - WINDOWS_VERSION=${{ steps.tag.outputs.windows_version }} |
113 | | - WINDOWS_TYPE=${{ matrix.container_type }} |
114 | | - push: ${{ env.IMAGE_PUSH }} |
115 | | - tags: ${{ steps.meta.outputs.tags }} |
116 | | - cache-from: type=gha |
117 | | - cache-to: type=gha,mode=max |
| 101 | + shell: pwsh |
| 102 | + run: | |
| 103 | + $tags = "${{ steps.meta.outputs.tags }}".Split(",") |
| 104 | + $tagArgs = @() |
| 105 | + foreach ($tag in $tags) { |
| 106 | + $tagArgs += "-t" |
| 107 | + $tagArgs += $tag.Trim() |
| 108 | + } |
| 109 | +
|
| 110 | + docker build ` |
| 111 | + --build-arg WINDOWS_VERSION=${{ steps.tag.outputs.windows_version }} ` |
| 112 | + --build-arg WINDOWS_TYPE=${{ matrix.container_type }} ` |
| 113 | + -f Dockerfile.windows ` |
| 114 | + $tagArgs ` |
| 115 | + . |
| 116 | +
|
| 117 | + if ("${{ env.IMAGE_PUSH }}" -eq "true") { |
| 118 | + foreach ($tag in $tags) { |
| 119 | + Write-Host "Pushing $($tag.Trim())" |
| 120 | + docker push $tag.Trim() |
| 121 | + } |
| 122 | + } |
0 commit comments