Add CD
This commit is contained in:
parent
b5d062ebca
commit
fa05625224
59
.drone.yml
Normal file
59
.drone.yml
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CD
|
||||
|
||||
steps:
|
||||
- name: restore cache
|
||||
image: drillster/drone-volume-cache
|
||||
volumes:
|
||||
- name: ng-pokemon-app-node
|
||||
path: /cache/ng-pokemon-app/node
|
||||
settings:
|
||||
restore: true
|
||||
mount:
|
||||
- ./node_modules
|
||||
|
||||
- name: generate
|
||||
image: node:19-alpine
|
||||
commands:
|
||||
- npm install
|
||||
- npm run ng build
|
||||
depends_on:
|
||||
- "restore cache"
|
||||
|
||||
- name: rebuild cache
|
||||
image: drillster/drone-volume-cache
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
settings:
|
||||
rebuild: true
|
||||
mount:
|
||||
- ./node_modules
|
||||
depends_on:
|
||||
- generate
|
||||
|
||||
- name: deploy stable
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
target:
|
||||
from_secret: ssh_target
|
||||
source: dist/ng-pokemon-app/*
|
||||
strip_components: 2
|
||||
username:
|
||||
from_secret: ssh_username
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
port:
|
||||
from_secret: ssh_port
|
||||
depends_on:
|
||||
- generate
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
Loading…
Reference in New Issue
Block a user