diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ec2a7c6..e9a68d66 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,13 @@ deploy_job: before_script: - 'which ssh-agent || (apk update && apk add curl openssh-client git grep)' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - echo "$GH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: - sh script.sh