fix(ci): docker caching (#30894)

This commit is contained in:
Jason Rasmussen
2026-08-20 16:37:43 -04:00
committed by GitHub
parent c8199ef32f
commit 24532c4d82
4 changed files with 52 additions and 70 deletions
-42
View File
@@ -397,7 +397,6 @@ jobs:
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
defaults:
run:
working-directory: ./e2e
@@ -441,33 +440,8 @@ jobs:
run: pnpm install --frozen-lockfile
if: ${{ !cancelled() }}
- name: Setup Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Login to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
if: ${{ github.event_name == 'push' && !github.event.pull_request.head.repo.fork }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve build cache
id: cache
run: |
ref=ghcr.io/immich-app/immich-server-build-cache:e2e-main-${{ runner.arch }}
echo "ref=$ref" >> "$GITHUB_OUTPUT"
if docker buildx imagetools inspect "$ref" > /dev/null 2>&1; then
echo "from=type=registry,ref=$ref" >> "$GITHUB_OUTPUT"
else
echo "from=" >> "$GITHUB_OUTPUT"
fi
- name: Start Docker Compose
id: docker
env:
E2E_CACHE_FROM: ${{ steps.cache.outputs.from }}
E2E_CACHE_TO: ${{ github.event_name == 'push' && !github.event.pull_request.head.repo.fork && format('type=registry,ref={0},mode=max', steps.cache.outputs.ref) || '' }}
run: docker compose up -d --build --renew-anon-volumes --force-recreate --remove-orphans --wait --wait-timeout 300
if: ${{ !cancelled() }}
@@ -545,24 +519,8 @@ jobs:
run: pnpm exec playwright install chromium --only-shell
if: ${{ !cancelled() }}
- name: Setup Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Resolve build cache
id: cache
run: |
ref=ghcr.io/immich-app/immich-server-build-cache:e2e-main-${{ runner.arch }}
echo "ref=$ref" >> "$GITHUB_OUTPUT"
if docker buildx imagetools inspect "$ref" > /dev/null 2>&1; then
echo "from=type=registry,ref=$ref" >> "$GITHUB_OUTPUT"
else
echo "from=" >> "$GITHUB_OUTPUT"
fi
- name: Docker build
id: docker
env:
E2E_CACHE_FROM: ${{ steps.cache.outputs.from }}
run: docker compose up -d --build --renew-anon-volumes --force-recreate --remove-orphans --wait --wait-timeout 300
if: ${{ !cancelled() }}