Skip to content

Commit 1dc2067

Browse files
fmalcherJohannesHoppe
authored andcommitted
docs: add installation section to README
this describes the new project selection handling
1 parent 6c037b7 commit 1dc2067

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub Actions](https://github.com/angular-schule/angular-cli-ghpages/actions/workflows/main.yml/badge.svg)](https://github.com/angular-schule/angular-cli-ghpages/actions/workflows/main.yml)
66
[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?color=blue&style=flat-square)](http://opensource.org/licenses/MIT)
77

8-
**Deploy your Angular app to GitHub pages directly from the Angular CLI! 🚀**
8+
**Deploy your Angular app to GitHub Pages or any other Git repo directly from the Angular CLI! 🚀**
99

1010
![Screenshot](docs/img/angular-cli-ghpages-deploy.gif)
1111

@@ -14,8 +14,9 @@
1414
1. [📖 Changelog](#changelog)
1515
2. [⚠️ Prerequisites](#prerequisites)
1616
3. [🚀 Quick Start (local development)](#quickstart-local)
17-
4. [🚀 Continuous Delivery](#continuous-delivery)
18-
5. [📦 Options](#options)
17+
4. [⚙️ Installation](#installation)
18+
5. [🚀 Continuous Delivery](#continuous-delivery)
19+
6. [📦 Deployment Options](#options)
1920
- [--base-href](#base-href)
2021
- [--build-target](#build-target)
2122
- [--no-build](#no-build)
@@ -27,9 +28,9 @@
2728
- [--no-dotfiles](#no-dotfiles)
2829
- [--cname](#cname)
2930
- [--dry-run](#dry-run)
30-
6. [📁 Configuration File](#configuration-file)
31-
7. [🌍 Environments](#environments)
32-
8. [⁉️ FAQ](#faq)
31+
7. [📁 Configuration File](#configuration-file)
32+
8. [🌍 Environments](#environments)
33+
9. [⁉️ FAQ](#faq)
3334

3435
<hr>
3536

@@ -63,14 +64,12 @@ If you use the old syntax, you will probably receive the following error:
6364

6465
**[Everything GitHub: Continuous Integration, Deployment and Hosting for your Angular App](https://angular.schule/blog/2020-01-everything-github)**
6566

66-
67-
6867
## ⚠️ Prerequisites <a name="prerequisites"></a>
6968

7069
This command has the following prerequisites:
7170

7271
- Git 1.9 or higher (execute `git --version` to check your version)
73-
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli) v9.0.0 or greater (execute `ng update` to upgrade your project if necessary)
72+
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli) v9.0.0 or greater
7473
- older Angular projects can still use the standalone program. See the documentation at [README_standalone](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_standalone.md).
7574

7675
## 🚀 Quick Start (local development) <a name="quickstart-local"></a>
@@ -101,7 +100,7 @@ If you already have an existing Angular project on GitHub, skip step 1 and 2.
101100
- Please enter the URL `https://github.com/<username>/<repositoryname>.git` into your browser – you should see your existing repository on GitHub.
102101
- Please double-check that you have the necessary rights to make changes to the given project!
103102

104-
3. Add `angular-cli-ghpages` to your project.
103+
3. Add `angular-cli-ghpages` to your project. For details, see the [installation section](#installation).
105104

106105
```sh
107106
ng add angular-cli-ghpages
@@ -125,6 +124,24 @@ If you already have an existing Angular project on GitHub, skip step 1 and 2.
125124
5. Your project should be available at `https://<username>.github.io/<repositoryname>`.
126125
Learn more about GitHub pages on the [official website](https://pages.github.com/).
127126

127+
## ⚙️ Installation <a name="installation"></a>
128+
129+
`angular-cli-ghpages` can be installed via `ng add`.
130+
This will install the NPM package and add the necessary `deploy` configuration to your `angular.json` file.
131+
132+
```sh
133+
ng add angular-cli-ghpages
134+
```
135+
136+
The `deploy` config will be added for the specified `defaultProject`.
137+
If there is no `defaultProject` set and there is only one project in your workspace, this project will be used.
138+
139+
If you have multiple projects in one workspace, you can manually define the project name:
140+
141+
```sh
142+
ng add angular-cli-ghpages --project MYPROJECTNAME
143+
```
144+
128145
## 🚀 Continuous Delivery <a name="continuous-delivery"></a>
129146

130147
If you run this command from a CI/CD environment, the deployment will most likely not work out of the box.
@@ -157,7 +174,7 @@ ng deploy --repo=https://github.com/<username>/<repositoryname>.git --name="Your
157174
>
158175
> 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](https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/m-p/26869) for more info. If your repo is public, you must still use the `GH_TOKEN` (personal access token).
159176
160-
## 📦 Options <a name="options"></a>
177+
## 📦 Deployment Options <a name="options"></a>
161178

162179
#### --base-href <a name="base-href"></a>
163180

0 commit comments

Comments
 (0)