cloudflare / pages-action

MIT License
440 stars 91 forks source link

Trunk based development and differentiating preview vs production env #114

Open nader-eloshaiker opened 6 months ago

nader-eloshaiker commented 6 months ago

I have recently switched my repo to trunk based where by I only have a main branch and features/fixes/chores go straight into it. Further, using google-github-actions/release-please-action, I use PR's to perform the releasing process. So stagging/preview and production deployments are done from the main branch. The my workflows are able to differentiate when to deploy to preview and production using the branch property in cloudflare/pages-action and it seems to work well. I use the value branch: stagging for feature merges and branch: main for production. However, what I have noticed in GitHub and in google-github-actions/release-please-action source code, is that the GitHub environment will always be production and not preview due to the fact that they both work off main despite the value of branch passed to the action.