From 082bf5d11720dbf49ddf8fd51b4472dfe33df24b Mon Sep 17 00:00:00 2001 From: /dev/urandom Date: Wed, 24 Nov 2021 17:14:00 +0300 Subject: [PATCH] set deploy to only happen on changes to main --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fed15a5..f6032be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,10 @@ unit-test-job: # This job runs in the test stage. deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + only: + - main #Do not run the deploy pipeline on merge requests before_script: + - if [ -z "$DEPLOY_PRIVATE_KEY" ]; then echo "Can't deploy without a private key."; exit 1; fi - echo "Installing the dependencies..." - apk add rsync openssh-client - mkdir -m 700 -p ~/.ssh