A build can be uploaded to Widgetbook Cloud using the Widgetbook CLI. We recommend to setup a CI/CD workflow to automatically upload builds for each commit and branch.
Uploading builds using CI/CD is the recommended way to publish Widgetbook Cloud builds for each of your commits. If you're trying Widgetbook Cloud for the first time, following the manual upload instructions is helpful to understand the process.
To follow the CI/CD setup guide select your Git provider below
To create a Widgetbook Build, follow these steps inside your Widgetbook project:
Run widgetbook_generator to generate metadata about your use-cases and components
dart run build_runner build -dBuild the Widgetbook for the web
# Default target (i.e. `lib/main.dart`)
flutter build web
# Custom target
flutter build web -t lib/main.widgetbook.dartInstall the Widgetbook CLI
dart pub global activate widgetbook_cli- Get your API key from the Widgetbook Cloud's project settings page.
Push the build to Widgetbook Cloud
widgetbook cloud build push --api-key PROJECT_API_KEYThe cloud push command uses the following directories:
build/web/to create a.ziparchive that will be uploaded to Widgetbook Cloud..dart_tool/build/generated/[your_app_name]/to send metadata, about the generated use-cases, that will be used for Widgetbook Cloud Review.

