It doesn’t cover all of your use cases, but take a look at this, particularly the examples, which includes a dry-run action.
e class='quote' data-post="1" data-topic="25410">Introducing Trellis GitHub Deployment.Trellis GitHub Deployment Automatically deploy your Trellis-based WordPress site to staging and production environments on merge to staging and main branches respectively, and keep plugins, themes, and WordPress core up to date with Dependabot. Features
Automatic (or manual) deployment to staging and production environments using GitHub Actions when pull requests are merged to your staging and main branches respectively. …