diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9977dee4a..7c5804fa6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -42,8 +42,11 @@ jobs: push: false load: true tags: mealie:e2e + # Read-only: the nightly workflow writes this cache from mealie-next, + # which every PR and merge queue ref can read. A cache that a PR or + # merge queue ref writes is visible to that ref only, and the export + # costs about 2 minutes per run. cache-from: type=gha - cache-to: type=gha,mode=max - name: Deploy E2E Test Environment run: | docker compose up -d --wait diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c525e9b3b..face740cb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,6 +30,35 @@ jobs: with: tag: nightly + e2e-image-cache: + name: "Build E2E Image Cache" + needs: build-package + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Retrieve Python package + uses: actions/download-artifact@v6 + with: + name: backend-dist + path: dist + + # Keep the build arguments in step with e2e.yml, or PR builds miss this cache. + - name: Build image into the cache + uses: docker/build-push-action@v7 + with: + file: ./docker/Dockerfile + context: . + build-contexts: | + packages=dist + outputs: type=cacheonly + cache-from: type=gha + cache-to: type=gha,mode=max + publish: permissions: contents: read