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-25 21:29:21 +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 (windows): ci 2024-06-25 21:25:44 +02:00
dist fix: use runner.temp for tmp cache file 2024-06-25 21:23:22 +02:00
script first commit 2024-06-12 19:56:12 +02:00
src fix: cache 2024-06-25 18:11:47 +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 fix: action 2024-06-23 15:08:36 +02:00
check-full-turbo.sh fix (windows): ci 2024-06-25 21:25:44 +02:00
LICENSE first commit 2024-06-12 19:56:12 +02:00
package-lock.json chore(deps): update dependency turbo to v2.0.5 2024-06-25 02:34:44 +00:00
package.json refactor: action post 2024-06-23 15:05:29 +02:00
README.md Merge pull request #40 from rharkor/dev 2024-06-25 21:29: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.5

The action will:

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

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

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