From b61c6d4abc71d650ee8045cf1f7c85214d0f57b6 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Jul 2025 13:32:34 -0300 Subject: [PATCH] =?UTF-8?q?ci:=20adiciona=20deploy=20autom=C3=A1tico=20par?= =?UTF-8?q?a=20homologa=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index b08af7f..af18e71 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,10 +1,15 @@ kind: pipeline type: docker -name: homolog +name: deploy + +trigger: + branch: + - main + - production steps: - name: deploy to homolog - image: appleboy/drone-scp + image: appleboy/scp settings: host: 216.22.5.141 username: root @@ -13,9 +18,11 @@ steps: source: . target: /home/app_fatura_homolog rm: true + when: + branch: main - - name: restart container - image: appleboy/drone-ssh + - name: restart homolog container + image: appleboy/ssh settings: host: 216.22.5.141 username: root @@ -23,5 +30,34 @@ steps: port: 22 script: - cd /home/app_fatura_homolog - - docker compose down + - docker compose down --remove-orphans - docker compose up -d + when: + branch: main + + - name: deploy to production + image: appleboy/scp + settings: + host: 216.22.5.141 + username: root + password: F6tC5tCh29XQRpzp + port: 22 + source: . + target: /home/app_fatura + rm: true + when: + branch: production + + - name: restart production container + image: appleboy/ssh + settings: + host: 216.22.5.141 + username: root + password: F6tC5tCh29XQRpzp + port: 22 + script: + - cd /home/app_fatura + - docker compose down --remove-orphans + - docker compose up -d + when: + branch: production