Deploying to production

Updating version

Whenever a new version is puiblished to production, the version of the package should be updated. SynergiWeb applications should use semver-like versioning. Semver doesn't really fit applications, but here are some guidelines for versioning:

  • Major version changes should indicate either a rewrite of the application, or changes that are big enough that users have to change how they work

  • Minor version changes should indicate new features in the application

  • Patch version changes should indicate bug fixes or small changes that users mostly won't notice

Use NPM to version your application, and push the tags created to GitHub.

pnpm version patch/minor/major
git push --follow-tags

Deploy with repo scripts

Use the repository scripts to create a release, build, deploy and publish your app.

From the app directory:

pnpm release

Or from the repo root:

pnpm --filter <app> release

What it does:

  • Prompts for the next semver, creates a tag and GitHub release with notes

  • Runs type checks, then pnpm build, pnpm deploy, and pnpm publish in the app

  • Optionally applies the update on production when passing --apply (if no other updates exist in the namespace)

Prerequisites:

  • GitHub CLI installed and authenticated (gh auth status)

  • Appframe CLI installed for apply step: pnpm i -g @olenbetong/appframe-cli

  • APPFRAME_LOGIN and APPFRAME_PWD set in your environment (e.g. .env)

Troubleshooting

If you have problems deploying, make sure tools and the app setup are current. Run pnpm update-setup in the app, ensure the GitHub CLI is up to date, and (if using apply) that the Appframe CLI is current (af update).

Some issues that can stop the deploy are:

  • Type errors. The CLI will run tsc and abort if there are type errors.

  • Uncommitted changes. Make sure all changes have been committed to git before releasing.

  • Other updates in the updater pipeline. If there are other updates in the AF updater pipeline, the release command will fail on the publish step. In this case, apply the update manually with af ntp <namespace> and af apply <namespace>. Remember to put changes by others on status On hold if you're not sure if they can be applied.

Last updated

Was this helpful?