Hey everyone ! I have only been developing using the Roots stack for a few months so I appreciate all answers, no matter how obvious they may seem to a more experienced developer
I successfully developed 2 separate wordpress sites (each with their own custom Sage theme) using trellis and bedrock on my local mac machine.
My file structure is a little different from the roots example project, it follows this recommendation: Multiple sites: trellis/ subfolder - meaning that i have one trellis install in the same parent directory as the two site directories. I have a separate github repository for each site directory, which does not include the trellis file.
To deploy one of the sites to production I provisioned a DigitalOcean droplet and successfully deployed using this command from my trellis folder:
> ansible-playbook deploy.yml -e "site=<domain> env=production"
I then arrived at the droplet expecting everything to look the same as my local site, but it was a fresh install of wordpress which totally freaked me out, until I read the docs more closely and realized that this was normal ! (https://roots.io/docs/trellis/master/deployments/#configuration)
Okay so then I followed this suggestion for exporting my database using
wp db export from inside my vagrant box and uploading the .sql file & my /uploads folder to my Droplet using FileZilla. This all worked perfectly and now my admin panel of the fresh wordpress install on the droplet looked exactly like my local install, and my custom sage theme was showing up in the Themes dashboard. Yay!
HERE IS WHERE THE PROBLEM BEGINS: I activated my theme and now the site is completely white (white page of doom )
So I read some more discourse topics, and reviewed the docs for deploying a sage theme correctly, SURPRISE, I did it wrong, so this time:
I first deleted my sage theme from the DO Droplet. Then I went back into the theme’s folder on my local machine, ran
yarn:production , then committed the site’s repo to github again (this time there is a /dist folder in my theme folder).
Based on this reply I decided to use FileZilla to simply send over my theme directory (WITHOUT the node_modules, and WITH the new /dist folder) to my digital ocean droplet’s themes folder. It sounded so simple and seemed to work perfectly! Except for the fact that the exact same white screen is appearing when I activate the theme ! again !
Some more information : I did uncomment all of the lines in the
build-before.yml file and replace “sage” with my theme name before i ran
yarn:production from inside the theme folder. I also SSH’d into my DO Droplet’s sage theme folder and ran comoser install, as per these docs.
At this point I am quite frustrated because I feel like the answer might be quite simple and I would really just love to be able to click “activate theme” and for it to appear like it does on my local machine, so ANY HELP is appreciated.
Thanks for being such an awesome community guys, I have already learned so much from you all <3