don't use build cache for node_modules

This commit is contained in:
Chuck Dries 2022-11-17 21:42:09 -08:00
parent 84ed3d5973
commit 40c62e2854
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6

View File

@ -14,7 +14,7 @@ steps:
settings: settings:
restore: true restore: true
mount: mount:
- ./node_modules # - ./node_modules
- ./.cache - ./.cache
- ./public - ./public
volumes: volumes:
@ -50,7 +50,7 @@ steps:
settings: settings:
rebuild: true rebuild: true
mount: mount:
- ./node_modules # - ./node_modules
- ./.cache - ./.cache
- ./public - ./public
volumes: volumes:
@ -62,58 +62,58 @@ volumes:
host: host:
path: /mnt/user/dronecache path: /mnt/user/dronecache
--- # ---
kind: pipeline # kind: pipeline
type: docker # type: docker
name: Preview PR # name: Preview PR
trigger: # trigger:
event: # event:
- pull_request # - pull_request
steps: # steps:
- name: restore-cache # - name: restore-cache
image: drillster/drone-volume-cache # image: drillster/drone-volume-cache
settings: # settings:
restore: true # restore: true
mount: # mount:
- ./node_modules # - ./node_modules
- ./.cache # - ./.cache
- ./public # - ./public
volumes: # volumes:
- name: cache # - name: cache
path: /cache # path: /cache
- name: build # - name: build
image: node # image: node
commands: # commands:
- yarn install # - yarn install
- PATH_PREFIX=/${DRONE_PULL_REQUEST} yarn build --prefix-paths # - PATH_PREFIX=/${DRONE_PULL_REQUEST} yarn build --prefix-paths
- du -sh public # - du -sh public
- name: rsync # - name: rsync
image: drillster/drone-rsync # image: drillster/drone-rsync
settings: # settings:
user: ci # user: ci
key: # key:
from_secret: rsync_key # from_secret: rsync_key
hosts: # hosts:
- droplet.chuckdries.com # - droplet.chuckdries.com
exclude: # exclude:
- node_modules # - node_modules
- .git* # - .git*
source: ./public/ # source: ./public/
target: ~/www/personal-website-preview/${DRONE_PULL_REQUEST} # target: ~/www/personal-website-preview/${DRONE_PULL_REQUEST}
prescript: cp -r ~/www/personal-website ~/www/personal-website-preview/${DRONE_PULL_REQUEST} # prescript: cp -r ~/www/personal-website ~/www/personal-website-preview/${DRONE_PULL_REQUEST}
delete: true # delete: true
recursive: true # recursive: true
secrets: [rsync_key] # secrets: [rsync_key]
- name: comment # - name: comment
image: jmccann/drone-github-comment:1 # image: jmccann/drone-github-comment:1
settings: # settings:
message: preview of ${DRONE_COMMIT} deployed to https://preview.chuckdries.com/${DRONE_PULL_REQUEST} # message: preview of ${DRONE_COMMIT} deployed to https://preview.chuckdries.com/${DRONE_PULL_REQUEST}
update: true # update: true
api_key: # api_key:
from_secret: github_key # from_secret: github_key
# note: we intentionally do not rebuild-cache for PRs # # note: we intentionally do not rebuild-cache for PRs