I am about to put my first Laravel project up. I am still early in development, but I am ready to have some testing, feedback, and all the other good stuff that comes from getting a staging server up. Here is my plan after watching the Envoyer videos, reading a bunch about Forge, and some other basic knowledge.
-
Use Forge to setup 2 servers on DigitalOcean. One for Production, one for Staging.
-
Setup HTTP basic auth blocking access to the staging server to unauthorized people. Thanks to Jacob Bennett for a simple solution: https://gistlog.co/JacobBennett/8193e13cef3427fbb88f
-
Create a "staging" branch for my git repository. Start working in this branch and only merging into master when I am ready for code to go to production.
-
Setup Envoyer with both servers. Set the production server to deploy automatically from the master branch of my projects github repo.
-
Modify the Envoyer deployment for production by adding hooks to artisan optimize and cache routes.
-
Setup Envoyer to deploy automatically from the staging branch to my staging server.
-
Modify the Envoyer deployment for staging by adding a hook to run migrate:fresh -- seed.
-
Setup different .env files for each server with the proper variables for staging or production.
This would seem to give me:
1 production server automatically deploying from my master branch whenever I push to github. This server would have production values in its .env and only migrate, but not seed when deplying.
1 staging server automatically deploying from my staging branch whenever I push that to github. This server would have staging values in its .env and it would wipe out the database, migrate it from scratch and re-seed it every time.
Am I missing anything here?