Skip to content

Commit 5967c5f

Browse files
committed
add build for github page deployment
1 parent 24ad3b4 commit 5967c5f

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.github/workflows/main_github_pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: npm ci
2323

2424
- name: Build Angular app
25-
run: npm run build:pages
25+
run: npm run build:pages2
2626

2727
- name: Deploy to GitHub Pages
2828
uses: JamesIves/github-pages-deploy-action@v4

angular.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,25 @@
118118
}
119119
]
120120
},
121+
"pages2": {
122+
"budgets": [
123+
{
124+
"type": "anyComponentStyle",
125+
"maximumWarning": "6kb"
126+
}
127+
],
128+
"optimization": true,
129+
"outputHashing": "all",
130+
"sourceMap": false,
131+
"namedChunks": false,
132+
"extractLicenses": true,
133+
"fileReplacements": [
134+
{
135+
"replace": "src/environments/environment.ts",
136+
"with": "src/environments/environment.pages2.ts"
137+
}
138+
]
139+
},
121140
"nas": {
122141
"budgets": [
123142
{
@@ -177,6 +196,9 @@
177196
},
178197
"pages": {
179198
"buildTarget": "text-compare-angular:build:pages"
199+
},
200+
"pages2": {
201+
"buildTarget": "text-compare-angular:build:pages2"
180202
},
181203
"nas": {
182204
"buildTarget": "text-compare-angular:build:nas"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"build:azure": "ng build --configuration azure",
2020
"build:netlify": "ng build --configuration netlify",
2121
"build:render": "ng build --configuration render",
22-
"build:pages": "ng build --configuration pages --base-href /text-compare-angular/ --deploy-url /text-compare-angular/",
22+
"build:pages": "ng build --configuration pages",
23+
"build:pages2": "ng build --configuration pages --base-href /text-compare-angular/ --deploy-url /text-compare-angular/",
2324
"build:nas": "ng build --configuration nas",
2425
"build:cross:env": "rimraf dist compiled && cross-env SOURCE_MAP=0 ng build --configuration production",
2526
"test": "ng test",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const environment = {
2+
production: true,
3+
envName: 'GitHub Pages',
4+
baseHref: '/text-compare-angular/',
5+
monacoBaseUrl: '/text-compare-angular/assets/monaco/min/vs'
6+
};

0 commit comments

Comments
 (0)