Last active
October 15, 2019 09:50
-
-
Save constgen/b184818e4b7af2c7eb84add9dc59065b to your computer and use it in GitHub Desktop.
Travis deploy with SSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "10.15" | |
install: | |
- npm install | |
cache: | |
directories: | |
- node_modules | |
script: | |
- npm test | |
- npm run build | |
#after_success: | |
# - echo $(<$TRAVIS_BUILD_DIR/build/VERSION) | |
# - echo $(<$TRAVIS_BUILD_DIR/build/BRANCH) | |
notifications: | |
email: | |
on_pull_requests: false | |
on_success: change | |
on_failure: change | |
# slack: | |
# on_success: change | |
# on_failure: change | |
# on_pull_requests: false | |
# rooms: | |
# - secure: XXXXXXXXXXXX | |
branches: | |
only: | |
- master | |
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ | |
addons: | |
ssh_known_hosts: | |
- 8.888.88.88 | |
- 8.888.88.89 | |
before_deploy: | |
- openssl aes-256-cbc -K $encrypted_13a92b926e32_key -iv $encrypted_13a92b926e32_iv -in deploy_rsa.enc -out deploy_rsa -d | |
- eval "$(ssh-agent -s)" | |
- chmod 600 deploy_rsa | |
- ssh-add deploy_rsa | |
deploy: | |
# Deploy to Testing environment | |
- deploy: | |
provider: script | |
skip_cleanup: true | |
script: rsync -vrh --delete-after $TRAVIS_BUILD_DIR/build/* [email protected]:/var/www/sensor-ui | |
on: | |
branch: master | |
# Deploy to Staging environment (release) | |
- deploy: | |
provider: script | |
skip_cleanup: true | |
script: rsync -rh --delete-after --quiet $TRAVIS_BUILD_DIR/build/* [email protected]:/var/www/sensor-ui | |
on: | |
tags: true | |
branch: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment