Skip to content

Cache Jekyll Picture Tag generated images in CI#68

Merged
wintermuted merged 1 commit into
masterfrom
copilot/cache-image-builds-in-actions
Dec 8, 2025
Merged

Cache Jekyll Picture Tag generated images in CI#68
wintermuted merged 1 commit into
masterfrom
copilot/cache-image-builds-in-actions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 11, 2025

Jekyll Picture Tag regenerates optimized images on every CI run, wasting time processing unchanged assets.

Changes

  • Added actions/cache@v4 step to active Jekyll build workflows (deploy.yml, deploy-pr-preview.yml)
  • Removed obsolete build-jekyll.yaml workflow (integrated with latest deployment method from PR Remove deprecated deployment workflow #70)
  • Cache path: generated/ directory where Jekyll Picture Tag outputs processed images
  • Cache key: Hashed on assets/img/** and _data/picture.yml to invalidate when source images or config change
  • Added generated/ to .gitignore
- name: Cache generated images
  uses: actions/cache@v4
  with:
    path: generated/
    key: ${{ runner.os }}-generated-images-${{ hashFiles('assets/img/**', '_data/picture.yml') }}
    restore-keys: |
      ${{ runner.os }}-generated-images-

Cache restores on subsequent runs when source images are unchanged, skipping expensive libvips processing.

This PR has been updated to integrate with the deployment method changes merged in PR #70, which removed the legacy build-jekyll.yaml workflow.

Original prompt

This section details on the original issue you should resolve

<issue_title>Cache image builds in actions</issue_title>
<issue_description>Rebuilding the image files in each action run is expensive and time consuming. Cache this folder across runs</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Cache image builds across action runs Cache Jekyll Picture Tag generated images in CI Nov 11, 2025
Copilot AI requested a review from wintermuted November 11, 2025 19:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 11, 2025

🚀 Preview deployment ready!

View your changes at: https://pr-68--reverent-aryabhata-74e98b.netlify.app

✨ Powered by Netlify - auto-updates on every commit and auto-deletes when PR is closed.

@wintermuted wintermuted marked this pull request as ready for review November 12, 2025 15:05
Copilot AI review requested due to automatic review settings November 12, 2025 15:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements caching for Jekyll Picture Tag generated images across all CI workflows to avoid expensive regeneration of unchanged images on every build.

Key Changes:

  • Added actions/cache@v4 step to cache the generated/ directory in all three Jekyll build workflows
  • Cache key invalidates when source images (assets/img/**) or picture configuration (_data/picture.yml) change
  • Added generated/ to .gitignore to exclude the cache directory from version control

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
.gitignore Added generated/ directory to exclude Jekyll Picture Tag output from version control
.github/workflows/deploy.yml Added image caching step and updated step numbering (Steps 3-6)
.github/workflows/deploy-pr-preview.yml Added image caching step and updated step numbering (Steps 3-7) for PR preview builds
.github/workflows/build-jekyll.yaml Added image caching step after existing dependency cache for the alternative build workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wintermuted
Copy link
Copy Markdown
Owner

@copilot this change needs to be integrated with the change in deployment method that was merged

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 12, 2025

@copilot this change needs to be integrated with the change in deployment method that was merged

Integrated the caching changes with the latest deployment method. Removed the obsolete build-jekyll.yaml workflow and kept the caching configuration in the two active workflows (deploy.yml and deploy-pr-preview.yml).

Changes in commit 66d1021.

@wintermuted wintermuted force-pushed the copilot/cache-image-builds-in-actions branch from 66d1021 to c11b5f0 Compare November 20, 2025 15:08
@wintermuted wintermuted force-pushed the copilot/cache-image-builds-in-actions branch from c11b5f0 to b1049a4 Compare December 7, 2025 17:08
Co-authored-by: wintermuted <2337325+wintermuted@users.noreply.github.com>
@wintermuted wintermuted force-pushed the copilot/cache-image-builds-in-actions branch from b1049a4 to e80ba07 Compare December 7, 2025 17:37
@wintermuted wintermuted merged commit 90291e2 into master Dec 8, 2025
1 check passed
@wintermuted wintermuted deleted the copilot/cache-image-builds-in-actions branch December 8, 2025 14:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 8, 2025

🧹 Preview deployment has been automatically cleaned up by Netlify.

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.

Cache image builds in actions

3 participants