From b79d9fc9c86ae7d7ff3561635ad7ec56e4a4d957 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sun, 20 Feb 2022 00:08:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20ssh=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f0ce71e..971808c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,17 @@ lint: deploy: stage: deploy + before_script: + # Install ssh if not already + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + # Make SSH key available + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + # Add known host keys + - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: - ssh gitdeploy@dreamcast.neuf.no "$(< bin/deploy)" only: