Skip to content

Commit b5ed315

Browse files
author
kallenberg
committed
Add check for local base image
1 parent c1eea69 commit b5ed315

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/docker.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ jobs:
2525
runs-on: self-hosted
2626
needs: set-up
2727
steps:
28-
29-
- uses: docker/build-push-action@v6
28+
- name: Check if base image exists locally
29+
id: check_base_image
30+
run: |
31+
if docker image inspect carla-base:ue4-${{ env.UBUNTU_DISTRO }} > /dev/null 2>&1; then
32+
echo "exists=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "exists=false" >> $GITHUB_OUTPUT
35+
fi
36+
37+
- name: Build base image
38+
if: steps.check_base_image.outputs.exists == 'false'
39+
uses: docker/build-push-action@v6
3040
name: Build image
3141
with:
3242
context: Util/Docker
@@ -36,6 +46,10 @@ jobs:
3646
build-args: |
3747
UBUNTU_DISTRO=${{ env.UBUNTU_DISTRO }}
3848
49+
- name: Reuse existing monolith image
50+
if: steps.check_monolith_image.outputs.exists == 'true'
51+
run: echo "Monolith image already exists locally, skipping rebuild."
52+
3953
create-monolith-image:
4054
name: Create monolith image
4155
runs-on: self-hosted

0 commit comments

Comments
 (0)