60 lines
1.0 KiB
YAML
60 lines
1.0 KiB
YAML
---
|
|
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
|