Skip to content

Commit

Permalink
github: build-container: Fix cached image loading
Browse files Browse the repository at this point in the history
Before cached images meant that the e2e tests would fail.

Additionally, before changing go dependencies meant that the
image would not rebuild. Now if backend dependencies change
a new image is built and tested.

Signed-off-by: René Dudfield <[email protected]>
  • Loading branch information
illume committed Jul 22, 2024
1 parent b8eb28f commit ae401aa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
path: ~/image-cache
# cache the container image. All the paths this PR depends on except the e2e-tests folder for the key.
key: ${{ runner.os }}-image-${{ hashFiles('backend/pkg/**', 'backend/cmd/**', 'frontend/src/**', 'frontend/package.json', 'frontend/package-lock.json', 'Makefile', '.github/**', 'Dockerfile', 'Dockerfile.plugins') }}
key: ${{ runner.os }}-image-${{ hashFiles('backend/pkg/**', 'backend/cmd/**', 'backend/go.*', 'frontend/src/**', 'frontend/package.json', 'frontend/package-lock.json', 'Makefile', '.github/workflows/build-container.yml', 'Dockerfile', 'Dockerfile.plugins') }}
- name: Restore Cached Docker Images
if: steps.cache-image-restore.outputs.cache-hit == 'true'
run: |
Expand Down Expand Up @@ -81,7 +81,6 @@ jobs:
echo -n "verifying images:"
docker images
- name: Import images to kind
if: steps.cache-image-restore.outputs.cache-hit != 'true'
run: |
export SHELL=/bin/bash
kind load docker-image ghcr.io/headlamp-k8s/headlamp-plugins-test:latest --name test
Expand Down

0 comments on commit ae401aa

Please sign in to comment.