You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB
YAML

kind: pipeline
type: docker
name: default
clone:
depth: 1
steps:
- name: build
pull: if-not-exists
image: node:latest
commands:
- export NODE_OPTIONS="--max-old-space-size=4096"
- npm config set registry https://registry.npmmirror.com
- npm install
- npm run build
- cp -r build/ live-release/
- ls -al live-release
- name: upload
pull: if-not-exists
image: appleboy/drone-scp
settings:
host:
from_secret: host
username:
from_secret: username
password:
from_secret: password
port: 22
target: /usr/share/nginx/html
source: live-release/*
- name: deploy
pull: if-not-exists
image: appleboy/drone-ssh
settings:
host:
from_secret: host
username:
from_secret: username
password:
from_secret: password
port: 22
script:
- cd /usr/share/nginx/html/
- rm -rf live
- echo "delete success"
- mv live-release live
- echo "deploy success"