diff --git a/.gitignore b/.gitignore index 0c96482..3d58dba 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ testem.log Thumbs.db src/assets/config.json +docs diff --git a/angular.json b/angular.json index 0195b9f..1c9a4f4 100644 --- a/angular.json +++ b/angular.json @@ -10,7 +10,8 @@ "style": "scss", "inlineStyle": true, "inlineTemplate": true, - "skipTests": true + "skipTests": true, + "changeDetection": "OnPush" } }, "root": "", @@ -54,7 +55,8 @@ "maximumError": "4kb" } ], - "outputHashing": "all" + "outputHashing": "all", + "baseHref": "https://railsstudent.github.io/ng-ai-google-demo/" }, "development": { "buildOptimizer": false, diff --git a/deploy-github-page.sh b/deploy-github-page.sh new file mode 100755 index 0000000..0f39035 --- /dev/null +++ b/deploy-github-page.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +./generate-config-file.sh $1 + +echo "delete docs" +rm -rf docs +echo "build project starts" +ng build --output-path docs/ +cp ./docs/browser/index.html ./docs/browser/404.html +cp ./docs/browser/* ./docs +rm -rf ./docs/browser +echo 'build project finishes' diff --git a/generate-config-file.sh b/generate-config-file.sh new file mode 100755 index 0000000..e1e3ec4 --- /dev/null +++ b/generate-config-file.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +apiConfig='{ + "apiKey": "'"$1"'" +}' + +outputFile='src/assets/config.json' +echo $apiConfig > $outputFile +