mirror of
https://github.com/rharkor/caching-for-turbo.git
synced 2025-06-08 01:37:01 +09:00
A Github action to set up Turborepo Remote Caching to work with GitHub Actions' built-in cache instead of Vercel one
|
||
---|---|---|
.devcontainer | ||
.github | ||
dist | ||
script | ||
src | ||
.eslintignore | ||
.gitattributes | ||
.gitignore | ||
.node-version | ||
.prettierignore | ||
.prettierrc.json | ||
action.yml | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
renovate.json | ||
tsconfig.json | ||
turbo.json |
Caching for Turborepo
Caching for Turborepo, using GitHub Actions’ cache service.
How to use
Add this to your GitHub Actions workflow, before running turbo build
.
- name: Cache for Turbo
uses: rharkor/caching-for-turbo@v1.2
The action will:
-
Launch a server on
localhost:41230
(and wait for it to be ready). -
Export the
TURBO_API
,TURBO_TOKEN
andTURBO_TEAM
environment variables for use byturbo build
. -
Set up a post-build step to print the server logs (for debugging).
Configuration
Configuration is optional. Here are the available options and their default values:
with:
# Set the prefix for the cache keys.
cache-prefix: turbogha_
Development
To run the tests:
Start a server in a separate terminal:
npm run dev-run
Run the tests:
npm test
License
This project is licensed under the MIT License - see the LICENSE file.
The code was inspired by dtinth but was entirely rewritten to be more robust.