feat: support CI
This commit is contained in:
parent
292dc579d7
commit
428ec15d12
39
.drone.yml
Normal file
39
.drone.yml
Normal file
@ -0,0 +1,39 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: git.vaala.cloud/vaalacat/node:16-alpine
|
||||
commands:
|
||||
- |
|
||||
npm config set registry https://registry.npmmirror.com
|
||||
npm i -g pnpm
|
||||
pnpm build
|
||||
pnpm export
|
||||
|
||||
- name: deploy
|
||||
image: git.vaala.cloud/vaalacat/python:3.6
|
||||
environment:
|
||||
SSH_PRIVATE_KEY:
|
||||
from_secret: SSH_PRIVATE_KEY
|
||||
SSH_TARGET:
|
||||
from_secret: SSH_TARGET
|
||||
SSH_USERNAME:
|
||||
from_secret: SSH_USERNAME
|
||||
DEPLOY_PATH:
|
||||
from_secret: DEPLOY_PATH
|
||||
commands:
|
||||
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client git curl -y )
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- ssh-keyscan $SSH_TARGET >> ~/.ssh/known_hosts
|
||||
- ssh $SSH_USERNAME@$SSH_TARGET "mkdir -p bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH ;bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH/*"
|
||||
- scp -r out/* $SSH_USERNAME@$SSH_TARGET:/opt/vaala/static/html/$DEPLOY_PATH
|
||||
- curl 'https://push.vaala.cloud/message/push?pushkey=PDU1TvwdaB33frA943WtFNc0EoSGTH0MhL9At&text=VaalaChatFrontDeploySuccess'
|
||||
when:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
Loading…
x
Reference in New Issue
Block a user