This has been discussed a few times, with various philosophies on handling environments for testing, staging, and production. I am at a point where all of the above are necessary, with an additional environment specifically for page-preparation (a clean way of generating optimal responsive images).
Simply put, my workflow looks like this:
- Testing: Develop templates and styling (on a non-cached Grav installation), using mock pages and content.
- Pages: Format and spellcheck actual pages, generate responsive images (non-destructively, through gulp).
- Staging: Test site with actual pages on current templates and styles (cached Grav).
- Production: Live, optimized site with actual pages etc.
I am wanting/trying to secure some level of consistency in the Staging and Production environments through version control, Git as it happens, but as ever that is a beast in itself and there are many a way to skin this cat. Thus, I am currently pushing template- and style-files from Testing, as well as Pages, to Staging, which when the y check out are pushed to BitBucket which automatically deploys to the Live server. Like so:
However, managing .gitignore-files, gulp pipelines and avoiding conflicts in Git really can be a hassle in terms of avoiding superfluous files or having to resolve conflicts down the line.
How do people prefer to set up their deployments, and what experiences do you have with multiple environments? Ideally I would hope to reduce the need for many repositories, and potentially allow for some CI-build system wherein changes were not pushed if PHP/Twig returned a fatal error.