Skip to content

Commit 1a80aec

Browse files
committed
If we're in GHA, expect the image to be loaded locally
1 parent 9009866 commit 1a80aec

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ jobs:
5757
tags: ${{ steps.meta.outputs.tags }}
5858
labels: ${{ steps.meta.outputs.labels }}
5959

60+
# Due to bug https://github.com/docker/buildx/issues/59, need to build for single platform, load, then run tests.
61+
- name: Build the image single platform and load it
62+
uses: docker/build-push-action@v5
63+
with:
64+
context: .
65+
push: false
66+
load: true
67+
cache-from: type=gha
68+
cache-to: type=gha,mode=max
69+
tags: "latest"
70+
labels: ${{ steps.meta.outputs.labels }}
71+
6072
- name: Build the image single platform and run tests
6173
run: ./tests.sh
6274

tests.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ fi
2828

2929
message " Check if we're in Github Actions "
3030
if [ -n "${GITHUB_ACTIONS}" ]; then
31-
message " Running in Github Actions "
31+
docker images
32+
if [ -z "$(docker images -q mendhak/http-https-echo:latest 2> /dev/null)" ]; then
33+
echo "Docker image mendhak/http-https-echo:latest not found. Exiting."
34+
exit 1
35+
fi
36+
else
37+
message " Local run. Build image "
38+
docker build -t mendhak/http-https-echo:latest .
3239
fi
3340

34-
message "List the docker images"
35-
docker images
36-
37-
message " Build image "
38-
docker build -t mendhak/http-https-echo:latest .
3941

4042
mkdir -p testarea
4143
pushd testarea

0 commit comments

Comments
 (0)