LinuxCommandLibrary

ng-deploy

Deploys an Angular application to a hosting provider

TLDR

Deploy the default project

$ ng deploy
copy
Deploy a specific project
$ ng deploy [project-name]
copy
Deploy with a build configuration
$ ng deploy --configuration production
copy
Deploy without building first
$ ng deploy --no-build
copy

SYNOPSIS

ng deploy [project] [options]

DESCRIPTION

ng deploy builds and deploys an Angular application to a remote hosting provider. The deploy command requires a deployment builder to be configured in the project's angular.json file, which is typically set up by adding a hosting provider package such as @angular/fire, @azure/ng-deploy, or @netlify-builder/deploy.
The command first runs the build process and then invokes the configured builder to upload the output to the target hosting environment.

PARAMETERS

project

The project to deploy. Defaults to the default project in the workspace.
--configuration name
Build configuration to use for deployment.
--no-build
Skip the build step before deploying.
--help
Display help information.

CONFIGURATION

A deploy builder must be added via ng add before using this command:

$ ng add @angular/fire
copy
$ ng add @netlify-builder/deploy
copy
$ ng add @azure/ng-deploy
copy
This registers the deploy target in angular.json under the project's architect section.

CAVEATS

Requires a deploy builder package to be installed and configured. Without one, the command will fail with a "no deploy target" error. Authentication with the hosting provider is typically required. Part of Angular CLI.

HISTORY

ng deploy was added to Angular CLI in version 8.3 (2019), providing a standardized interface for deployment across different hosting platforms through pluggable builders.

SEE ALSO

ng(1), ng-build(1), firebase(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community