Skip to content

Commit c099ebf

Browse files
committed
Deploy to Github Pages
1 parent 4556442 commit c099ebf

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22.x'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build Angular app
25+
run: npm run build:pages
26+
27+
- name: Deploy to GitHub Pages
28+
uses: JamesIves/github-pages-deploy-action@v4
29+
with:
30+
branch: gh-pages
31+
folder: dist/browser

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Three available demos:
2525
* `Live Demo on Netlify:` <a href="https://text-compare.netlify.app/" target="\_blank">https://text-compare.netlify.app/</a>
2626
* `Live Demo on Render:` <a href="https://text-compare.onrender.com/" target="\_blank">https://text-compare.onrender.com/</a>
2727
* `Live Demo on Azure:` <a href="https://text-compare.azurewebsites.net/" target="\_blank">https://text-compare.azurewebsites.net/</a>
28+
* `Live Demo on GitHub Page:` <a href="https://bit-developer.github.io/text-compare-angular/" target="\_blank">https://bit-developer.github.io/text-compare-angular/</a>
2829

2930
*Note: The demo websites may be slow when you access them for the first time. Be patient!*
3031

angular.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,25 @@
9999
}
100100
]
101101
},
102+
"pages": {
103+
"budgets": [
104+
{
105+
"type": "anyComponentStyle",
106+
"maximumWarning": "6kb"
107+
}
108+
],
109+
"optimization": true,
110+
"outputHashing": "all",
111+
"sourceMap": false,
112+
"namedChunks": false,
113+
"extractLicenses": true,
114+
"fileReplacements": [
115+
{
116+
"replace": "src/environments/environment.ts",
117+
"with": "src/environments/environment.pages.ts"
118+
}
119+
]
120+
},
102121
"nas": {
103122
"budgets": [
104123
{
@@ -156,6 +175,9 @@
156175
"render": {
157176
"buildTarget": "text-compare-angular:build:render"
158177
},
178+
"pages": {
179+
"buildTarget": "text-compare-angular:build:pages"
180+
},
159181
"nas": {
160182
"buildTarget": "text-compare-angular:build:nas"
161183
},

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
"scripts": {
1010
"start": "ng serve",
1111
"start:prod": "ng serve --configuration production",
12+
"start:azure": "ng serve --configuration azure",
13+
"start:netlify": "ng serve --configuration netlify",
14+
"start:render": "ng serve --configuration render",
15+
"start:pages": "ng serve --configuration pages",
1216
"start:nas": "ng serve --configuration nas",
1317
"start:mock": "node server.js",
1418
"build": "ng build --configuration production",
1519
"build:azure": "ng build --configuration azure",
1620
"build:netlify": "ng build --configuration netlify",
1721
"build:render": "ng build --configuration render",
22+
"build:pages": "ng build --configuration pages --base-href 'https://bit-developer.github.io/text-compare-angular/'",
1823
"build:nas": "ng build --configuration nas",
1924
"build:cross:env": "rimraf dist compiled && cross-env SOURCE_MAP=0 ng build --configuration production",
2025
"test": "ng test",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: true,
3+
env_name: 'GitHub Pages'
4+
};

0 commit comments

Comments
 (0)