Angular CLI GitHub/Cloudflare Pages Deployer

3.0.2 · active · verified Wed Apr 22

angular-cli-ghpages is an Angular CLI extension that streamlines the deployment of Angular applications to static hosting platforms like GitHub Pages and Cloudflare Pages. It integrates directly with the Angular CLI's `ng deploy` command, automating the build process, committing the compiled output to a specified Git branch (commonly `gh-pages`), and pushing it to a remote repository. The current stable version is 3.0.2, which supports Angular CLI 18 and newer. New major versions are typically released in sync with Angular's major releases to ensure compatibility. Its key differentiator is its seamless integration with the Angular development workflow, abstracting away manual Git operations and build output management for deployment.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install the Angular CLI, create a new project, link it to a GitHub repository, and deploy it to GitHub Pages using the `ng deploy` command.

npm install --location=global @angular/cli
ng new your-angular-project --no-standalone
cd your-angular-project

git remote add origin https://github.com/<username>/<repositoryname>.git

# Replace <username> and <repositoryname> with your GitHub details
# Create an empty GitHub repository first for this to work.

ng deploy

# When prompted, select 'GitHub Pages' from the options.
# This command will build your app and deploy it to the 'gh-pages' branch.

view raw JSON →