|
79 | 79 | # regardless of having code changes or not |
80 | 80 | fetch-depth: 1 |
81 | 81 |
|
82 | | - - name: Restore Build Cache |
83 | | - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 |
84 | | - with: |
85 | | - path: | |
86 | | - .turbo/cache |
87 | | - .next/cache |
88 | | - node_modules/.cache |
89 | | - # We want to restore cache from local .npm caches, .next/cache and node_modules/.cache |
90 | | - # As this should reduce build times, and the overall time for installing packages or running operations |
91 | | - key: cache-build-${{ hashFiles('package-lock.json') }}- |
92 | | - restore-keys: | |
93 | | - cache-build-${{ hashFiles('package-lock.json') }}- |
94 | | - cache-build- |
95 | | -
|
96 | 82 | - name: Set up Node.js |
97 | 83 | uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 |
98 | 84 | with: |
@@ -132,20 +118,3 @@ jobs: |
132 | 118 | # this should be a last resort in case by any chances the build memory gets too high |
133 | 119 | # but in general this should never happen |
134 | 120 | NODE_OPTIONS: '--max_old_space_size=4096' |
135 | | - |
136 | | - - name: Save Build Cache |
137 | | - # We want to store the Build Cache within Pull Requests or during pushes against the `main` branch |
138 | | - # since caches created on the `main` (default) branch can be reused on Pull Requests and PRs coming from forks |
139 | | - if: | |
140 | | - github.event_name == 'push' || github.event_name == 'pull_request_target' |
141 | | - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 |
142 | | - with: |
143 | | - path: | |
144 | | - .turbo/cache |
145 | | - .next/cache |
146 | | - node_modules/.cache |
147 | | - # Most of sibling Pull Requests will use the cache key based on the package-lock.json |
148 | | - # We do also add a hashFiles for `.next/cache` as GitHub Actions only allows |
149 | | - # One cache with same key to exist, so to ensure we always have a cache from the latest build |
150 | | - # We add the hashFiles of `.next/cache` to the cache key of the Cache Entry |
151 | | - key: cache-build-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.next/cache/**') }} |
0 commit comments