From 24db0a1251fdedb859cdf55f34a67927b94c2448 Mon Sep 17 00:00:00 2001 From: balex Date: Sat, 28 Feb 2026 20:02:21 +0100 Subject: [PATCH] jml --- .gitlab-ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d7a3b5..1cee6b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,14 +5,18 @@ stages: variables: REGISTRY: registry.gitlab.com/$CI_PROJECT_PATH -.deploy_setup: &deploy_setup - image: alpine:latest +.deploy_template: &deploy_setup + stage: deploy + image: alpine:3.20 before_script: - apk add --no-cache openssh-client - - eval $(ssh-agent -s) - - echo "$VPS_SSH_KEY" | ssh-add - - mkdir -p ~/.ssh - - echo "$VPS_HOST_KEY" >> ~/.ssh/known_hosts + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519 + - chmod 600 ~/.ssh/id_ed25519 + - ssh-keyscan -H $VPS_HOST >> ~/.ssh/known_hosts + environment: + name: production + url: https://balexvic.com publish: stage: publish @@ -32,7 +36,6 @@ publish: deploy: <<: *deploy_setup - stage: deploy needs: [publish] rules: - if: $CI_COMMIT_BRANCH == "main"