@@ -287,12 +287,33 @@ jobs:
287287 - name : Set up Docker Buildx
288288 uses : docker/setup-buildx-action@v3
289289
290- - name : Build & Start container
291- run : docker compose up -d --build ${{ matrix.image }}
290+ - name : Build and Load Docker Compose Images for Testing
291+ uses : docker/bake-action@v5
292+ with :
293+ files : docker-compose.yml
294+ load : true # CRITICAL: Load images into Docker daemon for 'docker compose up'
295+ set : |
296+ webapp.cache-from=type=gha,scope=buildkit-${{ github.run_id }}-webapp
297+ webapp.cache-to=type=gha,mode=max,scope=buildkit-${{ github.run_id }}-webapp
298+ scripts.cache-from=type=gha,scope=buildkit-${{ github.run_id }}-scripts
299+ scripts.cache-to=type=gha,mode=max,scope=buildkit-${{ github.run_id }}-scripts
300+ os.cache-from=type=gha,scope=buildkit-${{ github.run_id }}-os
301+ os.cache-to=type=gha,mode=max,scope=buildkit-${{ github.run_id }}-os
302+ build-args : |
303+ BUILD_PLATFORM=${{ matrix.platform }}
304+ # Pass the base image tag from the docker-image-build job
305+ BASE_IMAGE=${{ needs.docker-image-build.outputs.baseimage }}
306+
307+ - name : Start container stack
308+ # Now that all necessary images (webapp, scripts, os) are built and loaded
309+ # by the 'docker/bake-action', you just need to start the stack.
310+ # The '--build' flag is no longer necessary here.
311+ run : docker compose up -d
292312 env :
293- BUILD_PLATFORM : ${{ matrix.platform }}
294- BUILD_CACHE_FROM : type=gha,scope=buildkit-${{ github.run_id }}
295- BUILD_BASE_IMAGE : ${{ needs.docker-image-build.outputs.baseimage }}
313+ BUILD_PLATFORM : ${{ matrix.platform }} # Still pass runtime env if needed
314+ # BUILD_CACHE_FROM is not relevant for 'up' commands, only for 'build'
315+ # BUILD_BASE_IMAGE is already passed as a build-arg above if needed for runtime
316+
296317
297318 - name : Run tests
298319 run : ./docker/ci/test_${{ matrix.image }}.sh ${{ matrix.image }}
0 commit comments