@@ -53,10 +53,15 @@ jobs:
53
53
$repo = $env:GITHUB_REPOSITORY
54
54
$tag = "nsc-godbolt-build-${{ matrix.vendor }}-${{ matrix.config }}-${{ matrix.tag }}"
55
55
$nscTargetTaggedImage = "ghcr.io/${repo}:${tag}".ToLower()
56
+ $nscTargetTaggedImageLatest = "ghcr.io/${repo}:nsc-godbolt-latest".ToLower()
57
+
58
+ $shouldPushImage = ("${{ github.ref }}" -eq "refs/heads/master" -and "${{ matrix.vendor }}" -eq "msvc")
56
59
57
60
"prefix=$prefix" >> $env:GITHUB_OUTPUT
58
61
"nscTargetTaggedImage=$nscTargetTaggedImage" >> $env:GITHUB_OUTPUT
59
-
62
+ "nscTargetTaggedImageLatest=$nscTargetTaggedImageLatest" >> $env:GITHUB_OUTPUT
63
+ "shouldPushImage=$shouldPushImage" >> $env:GITHUB_OUTPUT
64
+
60
65
- name : Checkout
61
66
uses : actions/checkout@v4
62
67
with :
@@ -137,6 +142,7 @@ jobs:
137
142
with :
138
143
name : ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image
139
144
path : ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image.tar.zst
145
+ compression-level : 0
140
146
141
147
- name : Upload profiling artifacts
142
148
uses : actions/upload-artifact@v4
@@ -149,3 +155,17 @@ jobs:
149
155
with :
150
156
name : ${{ steps.set-prefix.outputs.prefix }}-install
151
157
path : ${{ steps.set-prefix.outputs.prefix }}-install.tar
158
+
159
+ - name : Login to GHCR
160
+ if : steps.set-prefix.outputs.shouldPushImage == 'True'
161
+ run : echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u $env:GITHUB_ACTOR --password-stdin
162
+
163
+ - name : Tag Latest image
164
+ if : steps.set-prefix.outputs.shouldPushImage == 'True'
165
+ run : |
166
+ docker tag ${{ steps.set-prefix.outputs.nscTargetTaggedImage }} ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
167
+
168
+ - name : Push images to GHCR
169
+ if : steps.set-prefix.outputs.shouldPushImage == 'True'
170
+ run : |
171
+ docker push ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
0 commit comments