This is the basics of how I work locally with a WordPress site, and then getting it to production.
Flywheel is a sponsor of CSS-Tricks, and I'm glad they are because they make great products. Flywheel is at the heart of this workflow.
First, Local by Flywheel is a tremendously easy way to spin up local WordPress sites to your liking. I use it for all my local WordPress development. It's a nice UI around little Docker containers.
My WordPress sites are all `wp-content` folders in private GitHub repos though, which is nice for working with other people, tracking issues, using integrations, etc.
When the master branch is pushed to on GitHub, Buddy (the service) picks up on that change and runs a pipeline of stuff. That goes like 1) Deploy over SFTP to Flywheel hosting 2) Clear the cache at Cloudflare 3) Send a notification over Slack.
Flywheel isn't just the local development, they are an awesome WordPress host. Cloudflare sits in front of it just for extra performance and protection.