This is an extra script for git-ftp. You can easily deploy to your staging or production environment. git-ftp already has the possibility the put your credentials in scopes. But this is an easier solution for me that I would like to share with you.
- Install git-ftp https://github.com/git-ftp/git-ftp/blob/master/INSTALL.md
- Place the deploy file in your project folder
- IMPORTANT .gitignore the deploy file
- Insert your hosting credentials (staging and production) in de deploy file
- Give permissions
chmod +x scriptname
- Be sure if your git repo is up to date - git push for latest version in repo.
- Run the script
./deploy
- Some questions will be asked
8.1. Do you want to init the project? [yes or no] Type
yes
if this project isn't online yet or typno
if you want to update your current project 8.2. Where to deploy? [staging or production] - Your project is being deployed.
- It takes some time to deploy depending on the size of your project.