Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,37 @@ jobs:

- name: Create environment file
run: |
echo "export const environment = {" > src/environments/environment.ts
echo " production: true," >> src/environments/environment.ts
echo " firebase: {" >> src/environments/environment.ts
echo " projectId: '${{ secrets.FIREBASE_PROJECT_ID }}'," >> src/environments/environment.ts
echo " appId: '${{ secrets.FIREBASE_APP_ID }}'," >> src/environments/environment.ts
echo " storageBucket: '${{ secrets.FIREBASE_STORAGE_BUCKET }}'," >> src/environments/environment.ts
echo " apiKey: '${{ secrets.FIREBASE_API_KEY }}'," >> src/environments/environment.ts
echo " authDomain: '${{ secrets.FIREBASE_AUTH_DOMAIN }}'," >> src/environments/environment.ts
echo " messagingSenderId: '${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}'" >> src/environments/environment.ts
echo " }," >> src/environments/environment.ts
echo " app_release_date: '${{ github.event.head_commit.timestamp }}'," >> src/environments/environment.ts
echo " app_release_version: '${{ github.sha }}'" >> src/environments/environment.ts
echo "};" >> src/environments/environment.ts
echo "export const environment = {" > src/environments/environment.prod.ts
echo " production: true," >> src/environments/environment.prod.ts
echo " firebase: {" >> src/environments/environment.prod.ts
echo " projectId: '${{ secrets.FIREBASE_PROJECT_ID }}'," >> src/environments/environment.prod.ts
echo " appId: '${{ secrets.FIREBASE_APP_ID }}'," >> src/environments/environment.prod.ts
echo " storageBucket: '${{ secrets.FIREBASE_STORAGE_BUCKET }}'," >> src/environments/environment.prod.ts
echo " apiKey: '${{ secrets.FIREBASE_API_KEY }}'," >> src/environments/environment.prod.ts
echo " authDomain: '${{ secrets.FIREBASE_AUTH_DOMAIN }}'," >> src/environments/environment.prod.ts
echo " messagingSenderId: '${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}'" >> src/environments/environment.prod.ts
echo " }," >> src/environments/environment.prod.ts
echo " app_release_date: '${{ github.event.head_commit.timestamp }}'," >> src/environments/environment.prod.ts
echo " app_release_version: '${{ github.sha }}'" >> src/environments/environment.prod.ts
echo "};" >> src/environments/environment.prod.ts

- name: Install dependencies
run: npm ci

- name: Build application
run: ng build --configuration production

- name: Ensure Deployment Directory Exists
run: mkdir -p dist/self-service-desk/browser
- name: Create .nojekyll file
run: touch dist/self-service-desk/browser/.nojekyll

- name: Deploy to GitHub Pages
run: ng deploy --project=selfservicedesk
run: ng deploy --project=selfservicedesk --no-silent
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
APP_RELEASE_DATE: ${{ github.event.head_commit.timestamp }}
APP_RELEASE_VERSION: ${{ github.sha }}
31 changes: 28 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@
"configurations": {
"production": {
"baseHref": "/SelfServiceDesk/",
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"budgets": [
{
"type": "initial",
Expand All @@ -79,14 +92,19 @@
"maximumError": "8kB"
}
],
"outputHashing": "all",
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
Expand Down Expand Up @@ -184,7 +202,14 @@
"deploy": {
"builder": "angular-cli-ghpages:deploy",
"options": {
"baseHref": "/SelfServiceDesk/"
"baseHref": "/SelfServiceDesk/",
"configuration": "production",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const environment = {};
13 changes: 13 additions & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const environment = {
production: true,
firebase: {
projectId: process.env['FIREBASE_PROJECT_ID'],
appId: process.env['FIREBASE_APP_ID'],
storageBucket: process.env['FIREBASE_STORAGE_BUCKET'],
apiKey: process.env['FIREBASE_API_KEY'],
authDomain: process.env['FIREBASE_AUTH_DOMAIN'],
messagingSenderId: process.env['FIREBASE_MESSAGING_SENDER_ID'],
app_release_date: process.env['APP_RELEASE_DATE'],
app_release_version: process.env['APP_RELEASE_VERSION'],
},
};
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"types": ["node"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down