Caching is hard

pull/7387/head
zomars 2023-02-24 12:45:49 -07:00
parent a8a10c0f35
commit cc4192817b
2 changed files with 8 additions and 8 deletions

View File

@ -11,13 +11,13 @@ runs:
cache-name: prod-build cache-name: prod-build
key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }} key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/web/next.config.js') }} key-2: ${{ hashFiles('apps/web/next.config.js') }}
key-3: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
with:
with: with:
path: | path: |
apps/web/.next ${{ github.workspace }}/apps/web/.next/cache
node_modules/.cache/turbo
**/.turbo/** **/.turbo/**
**/dist/** **/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ github.sha }} key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}- ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-

View File

@ -49,6 +49,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-db
with:
DATABASE_URL: ${{ env.DATABASE_URL }}
- uses: ./.github/actions/yarn-build - uses: ./.github/actions/yarn-build
with: with:
# GitHub Composite actions cannot read secrets, we have to pass them in here # GitHub Composite actions cannot read secrets, we have to pass them in here
@ -80,6 +83,3 @@ jobs:
NEXT_PUBLIC_IS_E2E: ${{ env.NEXT_PUBLIC_IS_E2E }} NEXT_PUBLIC_IS_E2E: ${{ env.NEXT_PUBLIC_IS_E2E }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }} TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }} TURBO_TEAM: ${{ env.TURBO_TEAM }}
- uses: ./.github/actions/cache-db
with:
DATABASE_URL: ${{ env.DATABASE_URL }}