/gatsby-cache

Cache build outputs for Gatsby's Conditional Page Build

Primary LanguageTypeScriptMIT LicenseMIT

Gatsby Cache

This action allows caching build outputs for Gatsby's Conditional Page Build.

LICENSE CodeFactor GitHub stars

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • key - An explicit key for restoring and saving the cache.
  • restore-keys - An ordered list of keys to use for restoring stale cache if no cache hit occurred for key.

Outputs

  • cache-hit - A boolean value to indicate an exact match was found for the key.

Note: cache-hit will be set to true only when cache hit occurs for the exact key match. For a partial key match via restore-keys or a cache miss, it will be set to false.

Cache Details

This action currently caches the following directories:

  • .cache (cache of data and rendered assets)
  • public (output of the build process)

Example workflow

- uses: actions/checkout@v3

- name: Set up Node.js
  uses: actions/setup-node@v3
  with:
   node-version: 20

- uses: jongwooo/gatsby-cache@v1

- name: Install dependencies
  run: npm ci

- name: Build
  run: npm run build

Contributing

Check out Contributing guide for ideas on contributing and setup steps for getting our repositories up.

License

Licensed under the MIT License.