I am looking for help on how to set up our projects to get the proper deployment workflow. For context, we have some packages that we publish, and we want to ensure that our documentation is only deployed to production when we actually release new versions of our package.
Currently, both the production and preview builds and deployments are happening automatically with every commit, with the exception of Production, which is building, but must be manually promoted.
Our expected behavior for each environment is as follows.
Preview - Continues to work the same, build/deploy on every commit that is not the main
branch
Production - We want to limit the builds/deployments to only happen when we actually release our package.
Steps that we have tried.
- We have attempted to use the Vercel CLI in a Github Action, but it seems our only option is to use a personal access token, it seems odd that for an enterprise or organization we would have to use a developers personal token in the CI/CD environment.
- We have tried setting the Ignored Build Step set to “Preview builds only” and then deploy production with a deploy hook, but the deploy hook will get cancelled out by the Ignored Build Step.
Ultimately we want to avoid have 99% of our production builds be irrelevant, and we want it limited to actual releases.