diff --git a/.github/workflows/main_text-compare2.yml b/.github/workflows/main_text-compare2.yml index 9a02a7b5..45544b6b 100644 --- a/.github/workflows/main_text-compare2.yml +++ b/.github/workflows/main_text-compare2.yml @@ -26,25 +26,25 @@ jobs: - name: npm install, build, and test run: | npm install - npm run build --if-present - npm run test --if-present + npm run build:azure + npm run test:headless - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 with: name: node-app - path: . + path: ./dist/browser deploy: runs-on: ubuntu-latest needs: build - + steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: name: node-app - + - name: 'Deploy to Azure Web App' id: deploy-to-webapp uses: azure/webapps-deploy@v3 @@ -52,4 +52,5 @@ jobs: app-name: 'text-compare2' slot-name: 'Production' package: . - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_23137CCA3349499E9B3DCC0705F4C348 }} \ No newline at end of file + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_23137CCA3349499E9B3DCC0705F4C348 }} + clean: true \ No newline at end of file diff --git a/angular.json b/angular.json index 2a278992..e5f63921 100644 --- a/angular.json +++ b/angular.json @@ -42,6 +42,63 @@ "browser": "src/main.ts" }, "configurations": { + "azure": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.azure.ts" + } + ] + }, + "netlify": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.netlify.ts" + } + ] + }, + "render": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.render.ts" + } + ] + }, "nas": { "budgets": [ { @@ -90,6 +147,15 @@ "buildTarget": "text-compare-angular:build" }, "configurations": { + "azure": { + "buildTarget": "text-compare-angular:build:azure" + }, + "netlify": { + "buildTarget": "text-compare-angular:build:netlify" + }, + "render": { + "buildTarget": "text-compare-angular:build:render" + }, "nas": { "buildTarget": "text-compare-angular:build:nas" }, diff --git a/package.json b/package.json index a41a5543..26cf8b74 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,9 @@ "start:nas": "ng serve --configuration nas", "start:mock": "node server.js", "build": "ng build --configuration production", + "build:azure": "ng build --configuration azure", + "build:netlify": "ng build --configuration netlify", + "build:render": "ng build --configuration render", "build:nas": "ng build --configuration nas", "build:cross:env": "rimraf dist compiled && cross-env SOURCE_MAP=0 ng build --configuration production", "test": "ng test", diff --git a/src/environments/environment.azure.ts b/src/environments/environment.azure.ts new file mode 100644 index 00000000..de4d7e27 --- /dev/null +++ b/src/environments/environment.azure.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + env_name: 'Azure' +}; diff --git a/src/environments/environment.netlify.ts b/src/environments/environment.netlify.ts new file mode 100644 index 00000000..b2d5a06f --- /dev/null +++ b/src/environments/environment.netlify.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + env_name: 'Netlify' +}; diff --git a/src/environments/environment.render.ts b/src/environments/environment.render.ts new file mode 100644 index 00000000..894616e5 --- /dev/null +++ b/src/environments/environment.render.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + env_name: 'Render' +};