diff --git a/.github/actions/cache-build/action.yml b/.github/actions/cache-build/action.yml index f35e51aa22..a57da06a7a 100644 --- a/.github/actions/cache-build/action.yml +++ b/.github/actions/cache-build/action.yml @@ -1,22 +1,22 @@ name: Cache production build binaries description: "Cache or restore if necessary" -inputs: - node_version: - required: true - description: "The node version used to run this" +env: + node_version: v16.x runs: using: "composite" steps: - name: Cache production build - id: prod-build-cache uses: actions/cache@v3 env: cache-name: prod-build - key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }} + key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }} key-2: ${{ hashFiles('apps/web/next.config.js') }} with: path: | apps/web/.next + node_modules/.cache/turbo + **/.turbo/** + **/dist/** 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 }}- diff --git a/.github/actions/yarn-build/action.yml b/.github/actions/yarn-build/action.yml index 60a81004f6..ba88ea2d29 100644 --- a/.github/actions/yarn-build/action.yml +++ b/.github/actions/yarn-build/action.yml @@ -67,21 +67,8 @@ runs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn-install - - name: Cache production build + - uses: ./.github/actions/cache-build id: prod-build-cache - 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') }} - with: - path: | - apps/web/.next - node_modules/.cache/turbo - 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 }}- - ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}- - name: Next.js production build if: steps.prod-build-cache.outputs.cache-hit != 'true' shell: bash