Supercharge your Turborepo builds with our dedicated GitHub Actions caching service, designed to make your CI workflows faster and more efficient.
This GitHub Action provides an alternative approach to Turborepo vercel remote caching in CI/CD pipelines. While Vercel's official solution works well, there are some key advantages to using this action:
- No need for Vercel account or tokens
- Works entirely within GitHub's ecosystem
- Reduces external service dependencies
- Free forever
The main technical difference lies in how caching is handled:
Vercel's Approach
- Uses a remote caching server hosted by Vercel
- Become expensive for large monorepos with multiple apps/packages
- May have limitations based on your Vercel plan
This Action's Approach
- Simulates a local remote caching server on
localhost:41230
- Uses GitHub Actions' built-in caching system
- Github will automatically remove old cache entries
This solution might be better when:
- You have a large monorepo with multiple apps/packages
- You want to avoid external service dependencies
- You need more control over your caching strategy
- You want to leverage GitHub's existing infrastructure
However, if you're already using Vercel and their remote caching works well for your needs, there's no pressing need to switch. Both solutions are valid approaches to the same problem.
Easily integrate our caching action into your GitHub Actions workflow by adding
the following step before you run turbo build
:
- name: Cache for Turbo
uses: rharkor/[email protected]
This GitHub Action facilitates:
- Server Initialization: Automatically spins up a server on
localhost:41230
. - Environment Setup: Sets up
TURBO_API
,TURBO_TOKEN
, andTURBO_TEAM
environment variables required byturbo build
. - Efficient Caching: Leverages GitHub's cache service to significantly accelerate build times.
Customize the caching behavior with the following optional settings (defaults provided):
with:
cache-prefix: turbogha_ # Custom prefix for cache keys
-
Start the development server:
npm run dev-run
-
In a separate terminal, execute the tests:
npm test
Licensed under the MIT License. For more details, see the LICENSE file.
This project is inspired by dtinth and has been comprehensively rewritten for enhanced robustness and reliability.