I’m trying to deploy the production version besides the staging version in the same server
so far I’ve been using project-name.com for all things, staging domain is project-name.our-agency.com but when I navigate to the server the folder is named project-name.com
I suspect that is because this is the value I used in group_vars/staging/wordpress_sites

My recommendation would be to use a different server for each environment and the issues you’ve mentioned should resolve. You’ll find various discussion in this Roots discourse of whether to put staging and production on the same server vs. separate servers. In my opinion the intention of Trellis and best practice generally is separate servers.

hostname alias in hosts file. If you must use a single server for both staging and production, use an alias in your hosts file (see option 1). Discussion in that thread will demonstrate how doing this will clarify for Ansible which vars are for staging vs. for production…

site key. If you must use a single server for both staging and production, use a different “site key” in your staging wordpress_sites dictionary:

wordpress_sites:
- nico.onl:
+ stage.nico.onl:
site_hosts:
...

Trellis uses this site key in some directory paths and file names. If on a single server you duplicate this key for different sites or envs, the duplicate will overwrite the original…