☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Saving files from your build back to your source

Last modified: February 12th, 2026

You can configure CloudCannon to commit built/generated files back to your source repository. This ensures that any generated files are consistent between CloudCannon and your source repository.

For example, if your site uses npm, you may want to automatically commit package-lock.json to your repository whenever it changes (e.g., by updating package.json).

SYNC_PATHS

To configure file updates:

  1. Navigate to Site Settings / Build
  2. Add a new environment variable called CLOUDCANNON_SYNC_PATHS.
  3. Add a comma-separated list of files and/or folders.

CloudCannon will use the value of this variable to determine which file's updates should be committed when your site builds. If you set a folder to be updated its entire contents will also be updated.

Screenshot of build settings with sync paths configured

Related Resources

Open in a new tab