ci: exclude .bin from node_modules cache, npm rebuild on restore
Build & Deploy / build-and-deploy (push) Successful in 2m1s
Build & Deploy / build-and-deploy (push) Successful in 2m1s
This commit is contained in:
@@ -20,7 +20,8 @@ jobs:
|
|||||||
CACHE_DIR=/usr/local/git/.cache/node_modules/${CACHE_KEY}
|
CACHE_DIR=/usr/local/git/.cache/node_modules/${CACHE_KEY}
|
||||||
if [ -d "$CACHE_DIR" ]; then
|
if [ -d "$CACHE_DIR" ]; then
|
||||||
echo "Restoring node_modules (${CACHE_KEY})"
|
echo "Restoring node_modules (${CACHE_KEY})"
|
||||||
rsync -a "$CACHE_DIR/" node_modules/
|
rsync -a --exclude='.bin/' "$CACHE_DIR/" node_modules/
|
||||||
|
npm rebuild --silent
|
||||||
echo "hit=true" >> $GITHUB_OUTPUT
|
echo "hit=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "hit=false" >> $GITHUB_OUTPUT
|
echo "hit=false" >> $GITHUB_OUTPUT
|
||||||
@@ -35,7 +36,7 @@ jobs:
|
|||||||
if: steps.nm-cache.outputs.hit != 'true'
|
if: steps.nm-cache.outputs.hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /usr/local/git/.cache/node_modules/${CACHE_KEY}
|
mkdir -p /usr/local/git/.cache/node_modules/${CACHE_KEY}
|
||||||
rsync -a --delete node_modules/ /usr/local/git/.cache/node_modules/${CACHE_KEY}/
|
rsync -a --delete --exclude='.bin/' node_modules/ /usr/local/git/.cache/node_modules/${CACHE_KEY}/
|
||||||
|
|
||||||
- name: Build or restore sharp for FreeBSD
|
- name: Build or restore sharp for FreeBSD
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user