diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e61a92a..af10986 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,16 +29,16 @@ build: deploy: stage: deploy script: + - if [[ "$CI_COMMIT_TAG" == "" ]]; then exit 0; fi - cd dist/web-remote - zip -r ../../remote-$CI_COMMIT_TAG.zip * - - cd ../../ - - mkdir -p ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - eval $(ssh-agent -s) - - ssh-add ~/.ssh/id_rsa - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - - ssh openlp@openlp.io "mkdir -p /home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG" - - scp remote-$CI_COMMIT_TAG.zip openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG/ - only: - - tags + - d ../../ + - cho "$CI_COMMIT_TAG" > version.txt + - kdir -p ~/.ssh + - cho "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + - hmod 600 ~/.ssh/id_rsa + - val $(ssh-agent -s) + - sh-add ~/.ssh/id_rsa + - '[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - sh openlp@openlp.io "mkdir -p /home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG" + - cp version.txt remote-$CI_COMMIT_TAG.zip openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG/