Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/run-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ jobs:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Docker buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

- name: Build cspell image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
cache-from: type=gha,scope=cspell
cache-to: type=gha,scope=cspell,mode=max
context: cspell
file: cspell/Dockerfile
load: true
tags: cspell:ci

- name: Run cspell
run: |
make check-spelling
Expand Down
9 changes: 5 additions & 4 deletions cspell/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
check-spelling: cspell-check

cspell-install:
@DOCKER_BUILDKIT=1 docker build \
--cache-from cspell \
cspell \
-t cspell
# Check if cspell:ci image exists (from CI build step), tag it to 'cspell' if found,
# otherwise build the image from scratch for local development.
@docker image inspect cspell:ci >/dev/null 2>&1 && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's goal of these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to avoid rebuilding the cspell Docker image from scratch on every CI run.

The workflow now builds the image once using Buildx with the GitHub Actions cache and tags it as cspell:ci.
The Makefile change simply reuses that image when it’s already available and falls back to a local build otherwise, so CI benefits from caching without changing local behavior.

docker tag cspell:ci cspell || \
docker build -t cspell cspell

cspell-check: CMD="--no-progress -r /nest"
cspell-check: cspell-install cspell-run
Expand Down