π Deploy your π °οΈAngular app to GitHub pages, Cloudflare Pages or any other Git repo directly from the Angular CLI! Available on NPM.
This release adds support for Angular v17. π
--no-silent
option, error messages will be shown by default now (modern CI systems don't expose secrets anymore)--dir
option, this overrides the directory for all published sources, relative to the current working directory. The normal logic with buildTargets and conventions is ignored in this case.--no-notfound
option to not create a 404.html
which should work great with Cloudflare pages, see #178 and see the Cloudflare pages docs
.nojekyll
file by default, can be disabled via --no-nojekyll
Install this beta version via
ng add [email protected]
This release adds support for Angular v16. π
schema.json
file that caused the issue.Deployed by @JohannesHoppe.
This release adds support for Angular v15. π
Many thanks to @EdricChan03 for fixing a peer dependency issue. (fixes #158 via #159) Deployed by @JohannesHoppe.
This release adds support for Angular v14. π
v1.0.1
or v1.0.2
β both packages are brokenThis release adds support for Angular v13. π
The code of this version is 100% identical to v1.0.0-rc.3. Only the version number was changed to work around the version resolution of yarn, which ignores npm dist-tags.
β οΈ BREAKING CHANGE (v1)
Starting with version 1 the option --configuration
was renamed to --build-target
.
BEFORE (does not work):
ng deploy --configuration=test
NOW:
ng deploy --build-target=test
If you use the old syntax, you will probably receive the following error:
An unhandled exception occurred: Configuration 'test' is not set in the workspace.
Deployed by @JohannesHoppe.
This release adds support for Angular v13. π
This release adds support for Angular v12. π
This release adds support for Angular v11. π
β οΈ BREAKING CHANGE (v1)
Starting with version 1 the option --configuration
was renamed to --build-target
.
BEFORE (does not work):
ng deploy --configuration=test
NOW:
ng deploy --build-target=test
If you use the old syntax, you will probably receive the following error:
An unhandled exception occurred: Configuration 'test' is not set in the workspace.
With this release, GitHub Actions becomes a first citizen alongside Travis CI and CircleCi.
Learn everything you need to know in the following article.
Everything GitHub: Continuous Integration, Deployment and Hosting for your Angular App
In this article we show several tools from the GitHub universe to launch a website with Angular. We will establish a professional pipeline, including version management, continuous deployment and web hosting. Best of all, for public repositories, this will not cost you a single cent! Read more...
The token GITHUB_TOKEN
is now supported. When using any token (GH_TOKEN / PERSONAL_TOKEN / GITHUB_TOKEN), it is no longer necessary to specify the --repo
parameter if the directory already has a remote repository. This is the case for GitHub actions. Please note that for GitHub actions git config user.name
and git config user.email
are not set. You still have to provide them.
βΉοΈ Note
The
GITHUB_TOKEN
(installation access token) will only trigger a release of a new website if the action runs in a private repository. In a public repo, a commit is generated, but the site does not change. See this GitHub Community post for more info. If your repo is public, you must still use theGH_TOKEN
(personal access token).
Special thanks goes out to @shhdharmen and @EdricChan03 who pushed this release forward! π
A valid main.yml
for GitHub Actions in a private repository could look like this:
name: Deploy to GitHub Pages via angular-cli-ghpages
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Prepare and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run ng -- deploy --base-href=/the-repositoryname/ --name="Displayed Username" [email protected] --no-silent
A valid main.yml
for GitHub Actions in a public repository could look like this:
name: Deploy to GitHub Pages via angular-cli-ghpages
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Prepare and deploy
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm install
npm run ng -- deploy --base-href=/the-repositoryname/ --name="Displayed Username" [email protected] --no-silent
This release has mainly improvements in error handling. It is now again possible to receive detailed logging messages using the --no-silent
option. Furthermore, the deployment is aborted if the previous build fails (thanks to @masaxsuzu).