Bedrock helps with deployment. Trellis deployment does basically the following:
- Prepare a new release directory that isn’t used yet, so it can be switched to very quickly from the previous release (also allows for fast rollback) (via symlink).
- Clone/update the PHP-code on the target using
- Install WordPress plugin dependencies and theme runtime dependencies using
- Build the theme on the deployment system/workstation (
- Upload the theme build artifacts onto the target.
- Optionally install/update core/plugin/theme languages.
- Some transient/cache clean up stuff to ensure smooth switching to the new release.
- Switch to the new release folder (via symlink).
For speeding up the deployment Trellis can re-use or share (via symlinks) some folders, like the vendor folder (or the languages folder if you use that; see this guide about language management):
composer and WordPress are mostly idempotent in their operation, which means that installing/updating plugins and language files will work with existing installations, also intelligently cleaning up older files.
Trellis is based on ansible which can manage multiple systems (servers).
Trellis deployment code: https://github.com/roots/trellis/tree/17430191bb7211545eb63ba3ba989ee95c262c5f/roles/deploy - especially https://github.com/roots/trellis/tree/17430191bb7211545eb63ba3ba989ee95c262c5f/roles/deploy/tasks
But you don’t have to use Trellis, you can also make your own deployment task/script on run that on each server automatically. For some many sites you may also bei interested in using a CI/CD pipeline that automatically updates the plugins, releases to staging and (after an optional manual approval process) to production.
There are also paid SaaS WordPress deployment solutions.