Skip to content

🎥 Make videos programmatically with React

Use Turborepo caching in GitHub Actions

Jonny Burger6a8b79039417
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 40a7bf06e3..70d558c0bb 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -38,21 +38,16 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: "packages/renderer -> target"
+ - name: Cache turbo build setup
+ uses: actions/cache@v4
+ with:
+ path: .turbo
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-turbo-
- name: Install
run: pnpm install --frozen-lockfile
- - name: Build cache
- uses: actions/[email protected]
- with:
- # Currently disabled but would love to enable:
- path: |
- tsconfig.tsbuildinfo
- packages/*/dist
- packages/*/tsconfig.tsbuildinfo
- packages/*/.turbo
- packages/docs/node_modules/.cache
- packages/example/node_modules/.cache
- packages/google-fonts/.cache-css
- key: ts-${{ runner.os }}-node16-v3
+
- name: build
run: |
pnpm build
@@ -80,13 +75,13 @@ jobs:
shell: bash
run: |
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- - uses: actions/cache@v3
- name: Setup pnpm cache
+ - name: Cache turbo build setup
+ uses: actions/cache@v4
with:
- path: ${{ steps.pnpm-cache.outputs.PNPM_STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ path: .turbo
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
- ${{ runner.os }}-pnpm-store-
+ ${{ runner.os }}-turbo-
- name: Install
run: pnpm install --frozen-lockfile
- name: Setup Python
@@ -100,28 +95,16 @@ jobs:
php-version: "8.3"
tools: phpunit:10.1.3
- run: pip install pylint boto3 pytest
- - name: Build cache
- uses: actions/[email protected]
- with:
- path: |
- tsconfig.tsbuildinfo
- packages/*/dist
- packages/*/tsconfig.tsbuildinfo
- packages/*/.turbo
- packages/docs/node_modules/.cache
- packages/example/node_modules/.cache
- packages/google-fonts/.cache-css
- key: ts-${{ runner.os }}-node16-v3
- uses: Swatinem/rust-cache@v2
with:
workspaces: "packages/renderer -> target"
- - name: Build cache
- uses: actions/[email protected]
+ - name: Cache turbo build setup
+ uses: actions/cache@v4
with:
- path: |
- packages/google-fonts/.cache-css
- key: ssr-${{ runner.os }}-node16-v3
-
+ path: .turbo
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-turbo-
- name: build
run: |
pnpm build
@@ -154,6 +137,13 @@ jobs:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
+ - name: Cache turbo build setup
+ uses: actions/cache@v4
+ with:
+ path: .turbo
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-turbo-
- name: Install
run: pnpm install --frozen-lockfile
- name: Perform stylecheck
@@ -196,19 +186,13 @@ jobs:
shell: bash
run: |
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- - uses: actions/cache@v3
- name: Setup pnpm cache
+ - name: Cache turbo build setup
+ uses: actions/cache@v4
with:
- path: ${{ steps.pnpm-cache.outputs.PNPM_STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ path: .turbo
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
- ${{ runner.os }}-pnpm-store-
-
- - name: Cache node_modules/.cache
- uses: actions/[email protected]
- with:
- path: node_modules/.cache
- key: deps-${{ runner.os }}-node${{ matrix.node_version }}-v3
+ ${{ runner.os }}-turbo-
- uses: Swatinem/rust-cache@v2
with:
workspaces: "packages/renderer -> target"
diff --git a/turbo.json b/turbo.json
index f7dc64fa6f..edd36408be 100644
--- a/turbo.json
+++ b/turbo.json
@@ -84,7 +84,8 @@
},
"@remotion/webcodecs#make": {
"dependsOn": ["^@remotion/media-parser#make"],
- "outputs": ["dist/esm/**"]
+ "outputs": ["dist/esm/**"],
+ "outputMode": "new-only"
},
"@remotion/convert#build-page": {
"dependsOn": ["^@remotion/webcodecs#make"]