CLI reference
Deploy CLI command reference
Deploys a statically built Sanity studio
USAGE
$ sanity deploy [SOURCEDIR]
ARGUMENTS
[SOURCEDIR] Source directory
FLAGS
--auto-updates Automatically update the studio to the latest version
--build Don't build the studio prior to deploy, instead deploying the version currently in `dist/`
--external Register an externally hosted studio
--minify Skip minifying built JavaScript (speeds up build, increases size of bundle)
--schema-required Fail-fast deployment if schema store fails
--source-maps Enable source maps for built bundles (increases size of bundle)
--verbose Enable verbose logging
-y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
DESCRIPTION
Builds and deploys Sanity Studio or application to Sanity hosting
EXAMPLES
Build and deploy the studio to Sanity hosting
sanity deploy
Deploys non-minified build with source maps
sanity deploy --no-minify --source-maps
Fail fast on schema store fails - for when other services rely on the stored schema
sanity deploy --schema-required
Register an externally hosted studio (studioHost contains full URL)
sanity deploy --externalWhat --no-build skips
By default, sanity deploy builds the Studio through Vite, extracts your schema and manifest, packages everything, and uploads it to Sanity hosting. Passing --no-build skips the build step but still runs schema extraction and upload. The dist/ directory must already exist. To make schema extraction fail instead of warn, pass --schema-required.