CreateDeploymentProps
export interface CreateDeploymentProps {
/**
* Forces a new deployment even if there is a previous similar deployment
*/
forceNew?: 0 | 1;
/**
* Allows to skip framework detection so the
* API would not fail to ask for confirmation
*/
skipAutoDetectionConfirmation?: 0 | 1;
/**
* The Team identifier or slug to perform the request on behalf of.
*/
teamId?: string;
/**
* A string with the project name used in the deployment URL
* @example my-instant-deployment
*/
name: string;
/**
* An deployment id for an existing deployment to redeploy
*/
deploymentId?: string;
/**
* A list of objects with the files to be deployed
*/
files?: (
| {
/**
* The file path relative to the project root
* @example folder/file.js
*/
file: string;
/**
* The file contents hashed with SHA1, used to check the integrity
*/
sha?: string;
/**
* The file size in bytes
*/
size?: number;
}
| {
/**
* The file content, it could be either a `base64` (useful for images, etc.)
* of the files or the plain content for source code
*/
data: string;
/**
* The file name including the whole path
* @example folder/file.js
*/
file: string;
/**
* The file content encoding, it could be either a `base64` (useful for images, etc.)
* of the files or the plain text for source code.
*/
encoding: 'base64' | 'utf-8';
}
)[];
/**
* Populates initial git metadata for different git providers.
*/
gitMetadata?: {
/**
* The name of the author of the commit
* @example kyliau
*/
commitAuthorName?: string;
/**
* The commit message
* @example add method to measure Interaction to Next Paint (INP) (#36490)
*/
commitMessage?: string;
/**
* The branch on which the commit was made
*/
commitRef?: string;
/**
* The hash of the commit
* @example dc36199b2234c6586ebe05ec94078a895c707e29
*/
commitSha?: string;
/**
* Whether or not there have been modifications to
* the working tree since the latest commit
* @example true
*/
dirty?: boolean;
/**
* The git repository's remote origin url
* @example "https://github.com/vercel/next.js"
*/
remoteUrl?: string;
};
/**
* Defines the Git Repository source to be deployed.
* This property can not be used in combination with files.
*/
gitSource?:
| {
owner: string;
ref: string;
slug: string;
type: 'bitbucket';
sha?: string;
}
| {
ref: string;
repoUuid: string;
type: 'bitbucket';
sha?: string;
workspaceUuid?: string;
}
| {
projectId: number | string;
ref: string;
type: 'gitlab';
sha?: string;
}
| {
org: string;
ref: string;
repo: string;
type: 'github';
sha?: string;
}
| {
ref: string;
repoId: number | string;
type: 'github';
sha?: string;
};
/**
* An object containing the deployment's metadata.
* Multiple key-value pairs can be attached to a deployment
*/
meta?: Record<string, any>;
/**
* The monorepo manager that is being used for this deployment.
* When `null` is used no monorepo manager is selected
*/
monorepoManager?: string | null;
/**
* The target project identifier in which the deployment will be created.
* When defined, this parameter overrides name
* @example my-deployment-project
*/
project?: string;
/**
* Project settings that will be applied to the deployment.
* It is required for the first deployment of a project and
* will be saved for any following deployments
*/
projectSettings?: {
/**
* The build command for this project.
* When `null` is used this value will be automatically detected
*/
buildCommand?: string | null;
commandForIgnoringBuildStep: string | null;
/**
* The dev command for this project.
* When `null` is used this value will be automatically detected
*/
devCommand?: string | null;
/**
* The framework that is being used for this project.
* When `null` is used no framework is selected
*/
framework?: Framework | null;
/**
* The install command for this project.
* When `null` is used this value will be automatically detected
*/
installCommand?: string | null;
/**
* The output directory of the project.
* When `null` is used this value will be automatically detected
*/
outputDirectory?: string | null;
/**
* The name of a directory or relative path to the source code of your project.
* When `null` is used it will default to the project root
*/
rootDirectory?: string | null;
/**
* The region to deploy Serverless Functions in this project
*/
serverlessFunctionRegion?: string | null;
/**
* Opts-out of the message prompting a CLI user
* to connect a Git repository in `vercel link`.
* @deprecated
*/
skipGitConnectDuringLink?: boolean;
/**
* Indicates if there are source files outside
* of the root directory, typically used for monorepos
*/
sourceFilesOutsideRootDirectory?: boolean;
};
/**
* Either not defined, `staging`, or `production`.
* If `staging`, a staging alias in the format `<project>-<team>.vercel.app`
* will be assigned. If `production`, any aliases defined in `alias` will be assigned.
* If omitted, the target will be `preview`
*/
target?: 'staging' | 'production';
/**
* When `true` and `deploymentId` is passed in, the sha from the previous deployment's
* `gitSource` is removed forcing the latest commit to be used.
*/
withLatestCommit?: boolean;
}