Use non-sudo user for CI/CD
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Sam A. 2023-01-14 00:18:57 +01:00
parent 5de80c144f
commit 07218e7b5b
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -15,22 +15,16 @@ steps:
- name: deploy
image: alpine/git:latest
environment:
SSH_USER:
from_secret: ssh_user
SSH_HOST:
from_secret: ssh_host
SSH_PORT:
from_secret: ssh_port
SSH_KEY:
from_secret: ssh_key
commands:
- mkdir ~/.ssh
- echo "$${SSH_KEY}" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh -o "StrictHostKeyChecking no" -p $${SSH_PORT}
$${SSH_USER}@$${SSH_HOST} "rm -rf docker/nginx/website/public/*"
- scp -o "StrictHostKeyChecking no" -P $${SSH_PORT} -r
./public $${SSH_USER}@$${SSH_HOST}:docker/nginx/website
- ssh -o "StrictHostKeyChecking no"
cicd@cpx.servers.sapti.me "rm -rf /opt/apps/nginx/website/public/*"
- scp -o "StrictHostKeyChecking no" -r
./public cicd@cpx.servers.sapti.me:/opt/apps/nginx/website
when:
branch:
- main