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://firstname.lastname@example.org/var/repo/site.git # Droplet 2
- git remote add beta ssh://email@example.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.
This article will teach you how to use Git when you want to deploy your application. While there are many ways to use Git to deploy our application, we'll focus on the one that is most straightforward.