From d5912767bd3a5b57c9150e0b851f51b2d9f6750b Mon Sep 17 00:00:00 2001 From: zomars Date: Fri, 24 Feb 2023 20:48:15 -0700 Subject: [PATCH] Cache fixes --- .github/actions/cache-build/action.yml | 15 ++++++++------- .github/actions/yarn-install/action.yml | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/actions/cache-build/action.yml b/.github/actions/cache-build/action.yml index e32460eaaf7e4f..7582ae9c380d77 100644 --- a/.github/actions/cache-build/action.yml +++ b/.github/actions/cache-build/action.yml @@ -1,7 +1,9 @@ name: Cache production build binaries description: "Cache or restore if necessary" -env: - node_version: v16.x +inputs: + node_version: + required: false + default: v16.x runs: using: "composite" steps: @@ -9,14 +11,13 @@ runs: uses: actions/cache@v3 env: cache-name: prod-build - key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }} - key-2: ${{ hashFiles('apps/web/next.config.js') }} - key-3: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }} + key-2: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }} with: path: | ${{ github.workspace }}/apps/web/.next **/.turbo/** **/dist/** - key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ github.sha }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}- + ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}- diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index 0d04c529f04c50..0a9be1454b4a5a 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -1,21 +1,23 @@ name: Yarn install description: "Install all NPM dependencies, caches them and restores if necessary" -env: - node_version: v16.x +inputs: + node_version: + required: false + default: v16.x runs: using: "composite" steps: - - name: Use Node ${{ env.node_version }} + - name: Use Node ${{ inputs.node_version }} uses: actions/setup-node@v3 with: - node-version: ${{ env.node_version }} + node-version: ${{ inputs.node_version }} cache: "yarn" - name: node_modules cache id: node-modules-cache uses: actions/cache@v3 env: cache-name: node-modules-yarn - cache-key: ${{ env.node_version }}-${{ hashFiles('yarn.lock', 'packages/prisma/schema.prisma') }} + cache-key: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock', 'packages/prisma/schema.prisma') }} with: path: | **/node_modules/**