Skip to content

Commit 7e6af24

Browse files
committed
upload NSC image to Github Container Registry on master push, create compose.yml for deploys
1 parent b18c834 commit 7e6af24

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/build-nabla.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ jobs:
5353
$repo = $env:GITHUB_REPOSITORY
5454
$tag = "nsc-godbolt-build-${{ matrix.vendor }}-${{ matrix.config }}-${{ matrix.tag }}"
5555
$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")
5659
5760
"prefix=$prefix" >> $env:GITHUB_OUTPUT
5861
"nscTargetTaggedImage=$nscTargetTaggedImage" >> $env:GITHUB_OUTPUT
59-
62+
"nscTargetTaggedImageLatest=$nscTargetTaggedImageLatest" >> $env:GITHUB_OUTPUT
63+
"shouldPushImage=$shouldPushImage" >> $env:GITHUB_OUTPUT
64+
6065
- name: Checkout
6166
uses: actions/checkout@v4
6267
with:
@@ -137,6 +142,7 @@ jobs:
137142
with:
138143
name: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image
139144
path: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image.tar.zst
145+
compression-level: 0
140146

141147
- name: Upload profiling artifacts
142148
uses: actions/upload-artifact@v4
@@ -149,3 +155,17 @@ jobs:
149155
with:
150156
name: ${{ steps.set-prefix.outputs.prefix }}-install
151157
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 }}

compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
nsc:
3+
container_name: nsc-godbolt
4+
image: ghcr.io/devsh-graphics-programming/nabla:nsc-godbolt-latest
5+
isolation: process
6+
ports:
7+
- "80:10240"
8+
volumes:
9+
- type: bind
10+
source: C:\Windows\Globalization\ICU
11+
target: C:\Windows\Globalization\ICU
12+
read_only: true
13+
- type: bind
14+
source: C:\Windows\System32
15+
target: C:\mount\Windows\System32
16+
read_only: true

0 commit comments

Comments
 (0)