Skip to content

Commit

Permalink
Add env with dev-specific url, update web.yml with build and run flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nbintertech committed Dec 12, 2024
1 parent a437246 commit 210f1e2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build-prod-web
run: |
if [[ "${{ github.ref_name }}" == "master" ]]; then
npm run build-prod-web
elif [[ "${{ github.ref_name }}" == "develop" ]]; then
npm run build-dev-web
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
27 changes: 23 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"ngswConfigPath": "ngsw-config.json"
},
"configurations": {
"web": {
"production-web": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -78,7 +78,23 @@
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.web.ts"
"with": "src/environments/environment.production-web.ts"
}
]
},
"development-web": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development-web.ts"
}
]
},
Expand Down Expand Up @@ -115,8 +131,11 @@
"buildTarget": "amo-tools-desktop:build"
},
"configurations": {
"web": {
"buildTarget": "amo-tools-desktop:build:web"
"production-web": {
"buildTarget": "amo-tools-desktop:build:production-web"
},
"development-web": {
"buildTarget": "amo-tools-desktop:build:development-web"
},
"development": {
"buildTarget": "amo-tools-desktop:build:development"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"build-watch": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --base-href . --watch",
"build-prod-desktop": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --base-href . --configuration desktop",
"build-prod-desktop-ci": "node --max_old_space_size=16000 ./node_modules/@angular/cli/bin/ng build --base-href . --configuration desktop",
"build-prod-web": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --base-href / --configuration web",
"build-prod-web": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --base-href / --configuration production-web",
"build-dev-web": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --base-href / --configuration development-web",
"clean": "rm -rf node_modules && rm -rf dist && rm -f package-lock.json",
"windows-clean": "powershell Remove-Item -Path \"package-lock.json\" && powershell Remove-Item -Path \"node_modules\", \"dist\" -Recurse",
"electron": "electron .",
Expand Down
11 changes: 11 additions & 0 deletions src/environments/environment.development-web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import packageInfo from '../../package.json';


export const environment = {
production: true,
name: 'development-web',
version: packageInfo.version,
useServiceWorker: true,
measurWeatherApi: 'https://dev.weather.ornl.gov/',
measurUtilitiesApi: 'https://dev.weather.ornl.gov/'
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import packageInfo from '../../package.json';

export const environment = {
production: true,
name: 'web',
name: 'production-web',
version: packageInfo.version,
useServiceWorker: true,
measurWeatherApi: 'https://weather.ornl.gov/',
Expand Down

0 comments on commit 210f1e2

Please sign in to comment.