I’m managed to set up up a droplet on DigitalOcean that’s working with my local development and am able to run successful deploys to the droplet. My local changes/compiled assets are not being pushed to my remote server. I’m curious why this doesn’t happen by default, and if, by design, I need to ssh into the remote server and re-compile manually every time I deploy?
I read through the thread below which outlines using a capistrano script, but it seems overly complicated when I was hoping my life was going to be simplified! I’m sure there’s a simple explanation to this.
Commit changes to your repo so that the deploy will pull those up-to-date source files.
You can have the deploy sync up your locally compiled assets using deploy hooks, specifically by uncommenting what you need in build-before.yml, which is already hooked up.
If your repo has a composer.json file listing plugins, the deploy will “Install Composer dependencies” (as mentioned in the default hooks section of the docs). If you have private plugins, search discourse for how people are handling those via composer. It’s probably less of a good idea than composer, but you could use deploy hooks to set up additional sync tasks for plugins, like the sync task in build-before.yml for compiled theme assets.
Thanks for the feedback regarding the docs. It would be fantastic if you could help us improve the docs via pull request.
Sometimes I’ll have a separate script for the uploads dir because I don’t necessarily want to sync them every time I deploy nor do I want them in my repo. Just do what works for your situation
Here’s an example: Pushing or pulling uploads with Trellis
I just use wp-cli which is included in Trellis, scp the file to local and commit to repo, plus weekly server backups. Probably a good idea to set up a script and/or cron for this too.
From what I’ve seen, a lot of people prefer a plugin that does this regularly, like BackupBuddy. I believe wp-db is still a manual process.