deploy: image: composer:latest only: - master before_script: # download dependencies - composer install # setup SSH - apk add --update openssh-client bash - eval $(ssh-agent -s) - bash -c 'ssh-add <(echo "$DEPLOY_PRIVKEY")' - mkdir -p ~/.ssh - chmod 700 ~/.ssh - ssh-keyscan thealternative.ch >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: # update files with git - ssh thealt-website@thealternative.ch 'cd /home/thealt-website/website; git pull' # replace dependencies - ssh thealt-website@thealternative.ch 'cd /home/thealt-website/website; rm -rf vendors' - scp -ra vendors thealt-website@thealternative.ch:/home/thealt-website/website