Skip to content

Commit

Permalink
Cache fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zomars committed Feb 25, 2023
1 parent 88aa6d5 commit d591276
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 8 additions & 7 deletions .github/actions/cache-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
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:
- name: Cache production build
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 }}-
12 changes: 7 additions & 5 deletions .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
@@ -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/**
Expand Down

0 comments on commit d591276

Please sign in to comment.