summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml10
1 files changed, 8 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b46ecb1..6f4fbff 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,9 +19,15 @@ deploy:
stage: deploy
image: ubuntu:22.04
before_script:
- - apt-get update && apt-get install -y sshpass docker.io
+ - apt-get update && apt-get install -y openssh-client
+ - mkdir -p ~/.ssh
+ - echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
+ - chmod 600 ~/.ssh/id_ed25519
+ - eval "$(ssh-agent -s)"
+ - ssh-add ~/.ssh/id_ed25519
+ - ssh-keyscan -H 192.168.0.171 >> ~/.ssh/known_hosts
script:
- - sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no arkadii@192.168.0.171 "
+ - ssh arkadii@192.168.0.171 "
docker stop $IMAGE_NAME || true &&
docker rm $IMAGE_NAME || true &&
docker build -t $IMAGE_NAME:$IMAGE_TAG /home/arkadii/artberry_backend &&