Skip to content

Commit 4b5f02f

Browse files
authored
docker/ci: Dont load default image on main commit (#279)
Signed-off-by: Ryan Northey <[email protected]>
1 parent 8bfc6e3 commit 4b5f02f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/_build_image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
OS_DISTRO: ${{ inputs.distro }}
8686
PUSH_GCR_IMAGE: ${{ inputs.gcr_push }}
8787
GCR_IMAGE_NAME: ${{ inputs.gcr_name }}
88+
LOAD_IMAGE: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
8889
- name: Set up Go
8990
uses: actions/setup-go@v4
9091
if: ${{ inputs.test_toolchain }}

docker/linux/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,7 @@ if [[ -n "${IMAGE_TAGS}" ]]; then
6969
done
7070
fi
7171

72-
# Testing after push to save CI time because this invalidates arm64 cache
73-
ci_log_run docker buildx build . -f "${OS_DISTRO}/Dockerfile" -t "${IMAGE_NAME}:${CONTAINER_TAG}" --platform "linux/amd64" --load
72+
if [[ "$LOAD_IMAGE" == "true" ]]; then
73+
# Testing after push to save CI time because this invalidates arm64 cache
74+
ci_log_run docker buildx build . -f "${OS_DISTRO}/Dockerfile" -t "${IMAGE_NAME}:${CONTAINER_TAG}" --platform "linux/amd64" --load
75+
fi

0 commit comments

Comments
 (0)