From fabf7f65d747b431aec78ff000c20212efcd2c1f Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 11 Nov 2023 08:47:42 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d705332..97c350e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,18 @@ stages: - deploy +before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + deploy_job: stage: deploy script: - - echo "$GITHUB_TOKEN" > /etc/ssl/certs/github_token.pem - - git config --global http.sslCAInfo /etc/ssl/certs/github_token.pem - git remote remove github || true - - git remote add github https://github.com/yun-ink/timerx.git + - git remote add github git@github.com:yun-ink/timerx.git - git remote -v - git checkout -b master - git branch