Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jongwooo/gatsby-cache
Cache build outputs for Gatsby's Conditional Page Build
https://github.com/jongwooo/gatsby-cache
build-cache conditional-page-build gatsbyjs github-actions
Last synced: 3 months ago
JSON representation
Cache build outputs for Gatsby's Conditional Page Build
- Host: GitHub
- URL: https://github.com/jongwooo/gatsby-cache
- Owner: jongwooo
- License: mit
- Created: 2022-11-16T04:27:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T02:01:30.000Z (3 months ago)
- Last Synced: 2024-10-01T16:00:00.196Z (3 months ago)
- Topics: build-cache, conditional-page-build, gatsbyjs, github-actions
- Language: TypeScript
- Homepage: https://jongwooo.github.io/gatsby-cache/
- Size: 1.92 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Gatsby Cache
This action allows caching build outputs for Gatsby's [Conditional Page Build](https://www.gatsbyjs.com/docs/reference/release-notes/v3.0/#incremental-builds-in-oss).
[![LICENSE](https://img.shields.io/github/license/jongwooo/gatsby-cache?color=blue)](LICENSE)
[![CodeFactor](https://www.codefactor.io/repository/github/jongwooo/gatsby-cache/badge)](https://www.codefactor.io/repository/github/jongwooo/gatsby-cache)
[![GitHub stars](https://img.shields.io/github/stars/jongwooo/gatsby-cache?style=social)](https://github.com/jongwooo/gatsby-cache)## 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](https://help.github.com/en/articles/configuring-a-workflow#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
```yaml
- 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](.github/CONTRIBUTING.md) for ideas on contributing and setup steps for getting our repositories up.
## License
Licensed under the [MIT License](LICENSE).