What is the correct way to set up a staging server and use github for version control?
I have Wordpress site at /var/www/contoso/html
(contoso.com) running on a CentOS 8 server. I would like to run a new theme and make some frontend changes to it to make it match the look and feel of the old theme. I imagine that using a staging instance is the way to go.
Is the proper approach to copy site files to /var/www/contoso-staging/html
(dev.contoso.com) and use a copy of the database? Or would it be possible to simply create a read-only database user and use the production database?
Also, I'd like to use version control for this. Would I create a GitHub repo for the production site and another for the staging site? Once the changes are finalized in staging, what would be the proper way to copy them over to live site?
If you have any suggestions outside of this, or if I am not on the right track, please feel free to offer your thoughts.
Thank you.