New drone config.

This commit is contained in:
aminecmi 2022-08-06 15:05:16 +02:00
parent 20069bfe84
commit 884877572b

View File

@ -1,5 +1,6 @@
kind: pipeline
type: docker
name: analyseAndBuild
steps:
- name: code-analysis
@ -26,7 +27,17 @@ steps:
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: CopyToServer
steps:
- name: scp files
image: appleboy/drone-scp
settings:
@ -37,6 +48,34 @@ steps:
port: 22
target: /home/ubuntu/courses
source: dist/*
when:
branch:
- main
trigger:
event:
- promote
target:
- production
---
kind: pipeline
type: ssh
name: Deploy
server:
host: amine-louveau.fr
user: ubuntu
ssh_key:
from_secret: ssh_key
steps:
- name: copy
commands:
- cd /home/ubuntu/courses
- mv dist/* ./
- sudo chown www-data:www-data ./*
- sudo rm -rf /var/www/amine/courses/*
- sudo mv ./* /var/www/amine/courses/
trigger:
event:
- promote
target:
- production