ci: Add build-on-miss fallback to E2E docker image load (#31232)
Some checks are pending
Build: Benchmark Image / build (push) Waiting to run
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.15.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Sync API Docs / sync-public-api (push) Waiting to run

Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
n8n-cat-bot[bot] 2026-05-27 21:45:17 +01:00 committed by GitHub
parent c14337e189
commit 3facc85e09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,9 +4,14 @@
#
# After this action runs, `n8nio/n8n:local` and `n8nio/runners:local` are
# present on the runner.
#
# If the cache entry has been evicted (e.g. Blacksmith cache thrash between
# prepare-docker and slow shards), the action falls back to invoking
# build-n8n-docker, which leaves both images tagged in dockerd and re-saves
# the tarball to cache as a side effect.
name: 'Load n8n Docker images from cache'
description: 'Restores the zstd-compressed n8n + runners image tarball from the variant+SHA-keyed GHA cache and loads both images into the local docker daemon.'
description: 'Restores the zstd-compressed n8n + runners image tarball from the variant+SHA-keyed GHA cache and loads both images into the local docker daemon. Falls back to rebuilding on cache miss.'
inputs:
build-variant:
@ -18,12 +23,25 @@ runs:
using: 'composite'
steps:
- name: Restore image tarball from cache
id: restore
uses: actions/cache/restore@640a1c2554105b57832a23eea0b4672fc7a790d5 # v4.2.3
with:
key: n8n-docker-image-${{ inputs.build-variant }}-${{ github.sha }}
path: /tmp/n8n-image.tar.zst
fail-on-cache-miss: true
- name: Load n8n and runners images into docker
if: steps.restore.outputs.cache-hit == 'true'
shell: bash
run: zstd -d -c /tmp/n8n-image.tar.zst | docker load
- name: Warn on cache miss
if: steps.restore.outputs.cache-hit != 'true'
shell: bash
run: |
echo "::warning::Cache miss for n8n-docker-image-${{ inputs.build-variant }}-${{ github.sha }} (SHA ${{ github.sha }}); falling back to rebuild via build-n8n-docker."
- name: Rebuild image on cache miss
if: steps.restore.outputs.cache-hit != 'true'
uses: ./.github/actions/build-n8n-docker
with:
build-variant: ${{ inputs.build-variant }}