Use non-sudo user for CI/CD
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5de80c144f
commit
07218e7b5b
14
.drone.yml
14
.drone.yml
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue