1
0
Fork 0
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
Find a file
2024-06-22 21:04:31 +02:00
.devcontainer chore(deps): update mcr.microsoft.com/devcontainers/typescript-node docker tag to v22 2024-06-13 14:24:06 +00:00
.github fix: ci 2024-06-22 21:00:17 +02:00
dist fix: output file 2024-06-22 20:52:04 +02:00
script first commit 2024-06-12 19:56:12 +02:00
src fix: output file 2024-06-22 20:52:04 +02:00
.eslintignore fix: action 2024-06-13 14:37:32 +02:00
.gitattributes first commit 2024-06-12 19:56:12 +02:00
.gitignore fix: ci 2024-06-13 13:53:22 +00:00
.node-version chore(deps): update dependency node to v20.15.0 2024-06-20 20:50:10 +00:00
.prettierignore first commit 2024-06-12 19:56:12 +02:00
.prettierrc.json first commit 2024-06-12 19:56:12 +02:00
action.yml feat: readme 2024-06-13 16:18:33 +02:00
LICENSE first commit 2024-06-12 19:56:12 +02:00
package-lock.json chore(deps): update dependency @types/node to v20.14.8 2024-06-22 07:44:58 +00:00
package.json chore(deps): update npm to v10.8.1 2024-06-13 14:21:28 +00:00
post.js fix: output file 2024-06-22 20:52:04 +02:00
README.md docs: version 2024-06-22 21:04:21 +02:00
renovate.json fix: renovate 2024-06-13 16:20:50 +02:00
tsconfig.json first commit 2024-06-12 19:56:12 +02:00
turbo.json feat: store cache 2024-06-13 14:27:20 +02:00

Caching for Turborepo

typescript-action status

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:

  1. Launch a server on localhost:41230 (and waits for it to be ready).

  2. Exports the TURBO_API, TURBO_TOKEN and TURBO_TEAM environment variables for use by turbo build.

  3. Sets 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.