Skip to content

Commit e8826d8

Browse files
authored
Fix the deployment to text-compare2 on azure (#62)
* Fix the deployment to text-compare2 on azure * trigger the build * add deployment config for azure * add deployment script for netlify and render * revert to main
1 parent 4704a25 commit e8826d8

File tree

6 files changed

+88
-6
lines changed

6 files changed

+88
-6
lines changed

.github/workflows/main_text-compare2.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,31 @@ jobs:
2626
- name: npm install, build, and test
2727
run: |
2828
npm install
29-
npm run build --if-present
30-
npm run test --if-present
29+
npm run build:azure
30+
npm run test:headless
3131
3232
- name: Upload artifact for deployment job
3333
uses: actions/upload-artifact@v4
3434
with:
3535
name: node-app
36-
path: .
36+
path: ./dist/browser
3737

3838
deploy:
3939
runs-on: ubuntu-latest
4040
needs: build
41-
41+
4242
steps:
4343
- name: Download artifact from build job
4444
uses: actions/download-artifact@v4
4545
with:
4646
name: node-app
47-
47+
4848
- name: 'Deploy to Azure Web App'
4949
id: deploy-to-webapp
5050
uses: azure/webapps-deploy@v3
5151
with:
5252
app-name: 'text-compare2'
5353
slot-name: 'Production'
5454
package: .
55-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_23137CCA3349499E9B3DCC0705F4C348 }}
55+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_23137CCA3349499E9B3DCC0705F4C348 }}
56+
clean: true

angular.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,63 @@
4242
"browser": "src/main.ts"
4343
},
4444
"configurations": {
45+
"azure": {
46+
"budgets": [
47+
{
48+
"type": "anyComponentStyle",
49+
"maximumWarning": "6kb"
50+
}
51+
],
52+
"optimization": true,
53+
"outputHashing": "all",
54+
"sourceMap": false,
55+
"namedChunks": false,
56+
"extractLicenses": true,
57+
"fileReplacements": [
58+
{
59+
"replace": "src/environments/environment.ts",
60+
"with": "src/environments/environment.azure.ts"
61+
}
62+
]
63+
},
64+
"netlify": {
65+
"budgets": [
66+
{
67+
"type": "anyComponentStyle",
68+
"maximumWarning": "6kb"
69+
}
70+
],
71+
"optimization": true,
72+
"outputHashing": "all",
73+
"sourceMap": false,
74+
"namedChunks": false,
75+
"extractLicenses": true,
76+
"fileReplacements": [
77+
{
78+
"replace": "src/environments/environment.ts",
79+
"with": "src/environments/environment.netlify.ts"
80+
}
81+
]
82+
},
83+
"render": {
84+
"budgets": [
85+
{
86+
"type": "anyComponentStyle",
87+
"maximumWarning": "6kb"
88+
}
89+
],
90+
"optimization": true,
91+
"outputHashing": "all",
92+
"sourceMap": false,
93+
"namedChunks": false,
94+
"extractLicenses": true,
95+
"fileReplacements": [
96+
{
97+
"replace": "src/environments/environment.ts",
98+
"with": "src/environments/environment.render.ts"
99+
}
100+
]
101+
},
45102
"nas": {
46103
"budgets": [
47104
{
@@ -90,6 +147,15 @@
90147
"buildTarget": "text-compare-angular:build"
91148
},
92149
"configurations": {
150+
"azure": {
151+
"buildTarget": "text-compare-angular:build:azure"
152+
},
153+
"netlify": {
154+
"buildTarget": "text-compare-angular:build:netlify"
155+
},
156+
"render": {
157+
"buildTarget": "text-compare-angular:build:render"
158+
},
93159
"nas": {
94160
"buildTarget": "text-compare-angular:build:nas"
95161
},

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"start:nas": "ng serve --configuration nas",
1313
"start:mock": "node server.js",
1414
"build": "ng build --configuration production",
15+
"build:azure": "ng build --configuration azure",
16+
"build:netlify": "ng build --configuration netlify",
17+
"build:render": "ng build --configuration render",
1518
"build:nas": "ng build --configuration nas",
1619
"build:cross:env": "rimraf dist compiled && cross-env SOURCE_MAP=0 ng build --configuration production",
1720
"test": "ng test",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: true,
3+
env_name: 'Azure'
4+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: true,
3+
env_name: 'Netlify'
4+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: true,
3+
env_name: 'Render'
4+
};

0 commit comments

Comments
 (0)