Last active
December 6, 2020 14:22
-
-
Save beingadityak/57eda9d52012e019594a3bfedfbf0b71 to your computer and use it in GitHub Desktop.
Travis CI - Sample web application deployment on commit
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: | |
- lts/* | |
# Add the lines from here apart from the auto-generated stuff | |
before_install: | |
- eval "$(ssh-agent -s)" | |
- chmod 600 /tmp/deploy_rsa | |
- ssh-add /tmp/deploy_rsa | |
before_deploy: | |
- rm -rf *.enc .env.enc | |
# Change the username as per your requirements | |
deploy: | |
- provider: script | |
skip_cleanup: true | |
script: rsync -e "ssh -o StrictHostKeyChecking=no" -r --quiet . ubuntu@$SERVER_IP:/home/ubuntu/webapp | |
on: | |
branch: master | |
- provider: script | |
skip_cleanup: true | |
script: ssh -o StrictHostKeyChecking=no ubuntu@$SERVER_IP 'bash ./scripts/restart.sh' | |
on: | |
branch: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment