pub fn deploy(
    dir: PathBuf,
    opts: &DeployOpts,
    tools: &Tools,
    global_opts: &Opts,
) -> Result<i32, Error> {
    // Fork at whether we're using static exporting or not
    let exit_code = if opts.export_static {
        deploy_export(dir, opts.output.to_string(), opts, tools, global_opts)?
    } else {
        deploy_full(dir, opts.output.to_string(), opts, tools, global_opts)?
    };

    Ok(exit_code)
}
Deploys the user's app to the `pkg/` directory (can be changed with
`-o/--output`). This will build everything for release and then put it all
together in one folder that can be conveniently uploaded to a server, file
host, etc. This can return any kind of error because deploying involves
working with other subcommands.

Note that this will execute a full copy of all static assets, so apps with
large volumes of these may have longer deployment times.
packages/perseus-cli/src/deploy.rs