fix(workflow): fix workflow not to double build the webapp image when running unit test (#9210)

This commit is contained in:
Ulf Gebhardt 2026-02-13 17:04:17 +01:00 committed by GitHub
parent 93309bf4f3
commit 91fac6f7c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,8 +51,8 @@ jobs:
- name: Webapp | Build 'test' image
run: |
docker build --target test -f webapp/Dockerfile -t "ocelotsocialnetwork/webapp:test" .
docker save "ocelotsocialnetwork/webapp:test" > /tmp/webapp.tar
docker build --target test -f webapp/Dockerfile -t "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" .
docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
- name: Cache docker image
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
@ -102,9 +102,8 @@ jobs:
cp webapp/.env.template webapp/.env
cp backend/.env.template backend/.env
- name: backend | docker compose
# doesn't work without the --build flag - this either means we should not load the cached images or cache the correct image
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp --build
- name: Start webapp container
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp
- name: webapp | Unit tests incl. coverage check
run: docker compose exec -T webapp yarn test