Add node_modules caching to build
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
021dfe0e3e
commit
c471bee62f
31
.drone.yml
31
.drone.yml
@ -1,6 +1,22 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
|
type: docker
|
||||||
steps:
|
steps:
|
||||||
|
# ============ RESTORE CACHE =============
|
||||||
|
- name: restore node_modules cache
|
||||||
|
image: appleboy/drone-sftp-cache
|
||||||
|
server:
|
||||||
|
from_secret: cache_server
|
||||||
|
port: 22
|
||||||
|
username:
|
||||||
|
from_secret: cache_server_user
|
||||||
|
key:
|
||||||
|
from_secret: cache_server_key
|
||||||
|
path: /var/cache/noded-frontend-node_modules
|
||||||
|
restore: true
|
||||||
|
mount:
|
||||||
|
- node_modules
|
||||||
|
|
||||||
# ============ BUILD STEPS ===============
|
# ============ BUILD STEPS ===============
|
||||||
- name: build-prod
|
- name: build-prod
|
||||||
image: node:14
|
image: node:14
|
||||||
@ -11,6 +27,21 @@ steps:
|
|||||||
- ./node_modules/.bin/ngsw-config ./www/ ./ngsw-config.json /i
|
- ./node_modules/.bin/ngsw-config ./www/ ./ngsw-config.json /i
|
||||||
- tar czf build.tar.gz www
|
- tar czf build.tar.gz www
|
||||||
|
|
||||||
|
# =============== REBULD CACHE ==============
|
||||||
|
- name: rebuild node_modules cache
|
||||||
|
image: appleboy/drone-sftp-cache
|
||||||
|
server:
|
||||||
|
from_secret: cache_server
|
||||||
|
port: 22
|
||||||
|
username:
|
||||||
|
from_secret: cache_server_user
|
||||||
|
key:
|
||||||
|
from_secret: cache_server_key
|
||||||
|
path: /var/cache/noded-frontend-node_modules
|
||||||
|
rebuild: true
|
||||||
|
mount:
|
||||||
|
- node_modules
|
||||||
|
|
||||||
# =============== RELEASE ===============
|
# =============== RELEASE ===============
|
||||||
- name: release
|
- name: release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
|
Loading…
Reference in New Issue
Block a user