Skip to content

Improved production Docker image loading in CI#28105

Merged
9larsons merged 1 commit into
mainfrom
skip-local-docker-load
May 25, 2026
Merged

Improved production Docker image loading in CI#28105
9larsons merged 1 commit into
mainfrom
skip-local-docker-load

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

@9larsons 9larsons commented May 25, 2026

Summary

  • avoids loading the pushed full production image into the local Docker daemon on trusted CI runs
  • skips the non-gating Docker image size/layer summary on trusted runs, because it depends on the image being loaded locally
  • keeps local loading and image inspection for artifact-based fork/cross-repo PR runs

Why

The full image is already pushed to GHCR on trusted runs. Loading it locally is only needed for artifact transfer/reporting and was adding roughly 45-60s of export/import overhead after BuildKit cache hits.

The skipped reporting is informational only: it runs docker inspect and docker history to write image size and layer details to the GitHub Step Summary. It does not enforce thresholds, alert, or gate CI.

Testing

  • git diff --check -- .github/workflows/ci.yml

The full production image is already pushed to GHCR on trusted CI runs, so loading it back into the local Docker daemon only adds export/import time for optional image reporting. Keep local loading for artifact-based fork runs where downstream jobs need it.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Review Change Stack

Walkthrough

This PR updates the CI workflow in .github/workflows/ci.yml to optimize Docker artifact handling in the job_build_artifacts step. The load parameter for the "full" image build is now conditional: it is set to true only when should-push is false, rather than always loading. Additionally, the "Inspect image size and layers" step is now gated behind a condition checking steps.strategy.outputs.use-artifact == 'true', ensuring the inspection only runs when an image is available locally.

Possibly related PRs

  • TryGhost/Ghost#28078: Overlaps directly in job_build_artifacts by conditionally running image/artifact-related steps based on steps.strategy.outputs.use-artifact == 'true' and adjusting Docker load behavior.
  • TryGhost/Ghost#28001: Modifies .github/workflows/ci.yml to add conditional gating around job_build_artifacts execution and related steps via build/E2E lane gates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: improving Docker image loading behavior in CI by conditionally skipping local load for trusted runs while maintaining it for artifact-based runs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly explains the changes: avoiding Docker image loading on trusted CI runs to reduce overhead, while retaining it for artifact-based runs where needed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch skip-local-docker-load

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.81%. Comparing base (4269498) to head (34dd2c9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28105      +/-   ##
==========================================
- Coverage   73.82%   73.81%   -0.01%     
==========================================
  Files        1528     1528              
  Lines      129417   129417              
  Branches    15509    15506       -3     
==========================================
- Hits        95537    95527      -10     
- Misses      32924    32934      +10     
  Partials      956      956              
Flag Coverage Δ
admin-tests 54.03% <ø> (ø)
e2e-tests 73.81% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons 9larsons merged commit 3457875 into main May 25, 2026
50 checks passed
@9larsons 9larsons deleted the skip-local-docker-load branch May 25, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant