I followed this tutorial : https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps
in this tutorial the beta we push up to is on the same server as the live one. what do i need to do to be able to push from git to beta, but then from beta on droplet1 to live on droplet2?
going to use it as a beta server.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
While that tutorial serves both the production site and the beta from the same Droplet, you should be able to apply the same technique with seperate servers.
From inside of the git repository serving the beta, the tutorial suggests running:
cd /var/repo/beta.git
git remote add live ../site.git
This is adding a git remote pointing to another repository local on the same server (../site.git). You can just as easily add one for a remote server. If you set up two separate remotes:
git remote add live ssh://user@mydomain.com/var/repo/site.git # Droplet 2
git remote add beta ssh://user@staging.mydomain.com/var/repo/site.git # Droplet 1
You can then run git push beta master to push to your staging server or git push live master to push to your production one.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.