1- # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2- # More GitHub Actions for Azure: https://github.com/Azure/actions
3-
4- name : Build and deploy Node.js app to Azure Web App - exprec
5-
6- on :
7- push :
8- branches :
9- - github
10- workflow_dispatch :
11-
12- jobs :
13- build :
14- runs-on : ubuntu-latest
15- permissions :
16- contents : read # This is required for actions/checkout
17-
18- steps :
19- - uses : actions/checkout@v4
20-
21- - name : Set up Node.js version
22- uses : actions/setup-node@v3
23- with :
24- node-version : ' 18.20.3'
25-
26- - name : npm install, build, and test
27- run : |
28- npm install
29- npm run build --if-present
30- npm run test --if-present
31-
32- - name : Zip artifact for deployment
33- run : zip release.zip ./* -r
34-
35- - name : Upload artifact for deployment job
36- uses : actions/upload-artifact@v4
37- with :
38- name : node-app
39- path : release.zip
40-
41- deploy :
42- runs-on : ubuntu-latest
43- needs : build
1+ name : Build and deploy Node.js app to Azure Web App - exprec
2+
3+ on :
4+ push :
5+ branches :
6+ - github
7+ workflow_dispatch :
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read # This is required for actions/checkout
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Set up Node.js version
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : ' 18.20.3'
22+
23+ - name : npm install, build, and test
24+ run : |
25+ npm install
26+ npm run build --if-present
27+ npm run test --if-present
28+
29+ - name : Zip artifact for deployment
30+ run : zip release.zip ./* -r
31+
32+ - name : Upload artifact for deployment job
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : node-app
36+ path : release.zip
37+
38+ deploy :
39+ runs-on : ubuntu-latest
40+ needs : build
4441 environment :
4542 name : ' Production'
46- url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
43+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
4744 permissions :
48- id-token : write # This is required for requesting the JWT
49- contents : read # This is required for actions/checkout
50-
51- steps :
52- - name : Download artifact from build job
53- uses : actions/download-artifact@v4
54- with :
55- name : node-app
56-
57- - name : Unzip artifact for deployment
58- run : unzip release.zip
59-
45+ id-token : write # This is required for requesting the JWT
46+ contents : read # This is required for actions/checkout
47+
48+ steps :
49+ - name : Download artifact from build job
50+ uses : actions/download-artifact@v4
51+ with :
52+ name : node-app
53+
54+ - name : Unzip artifact for deployment
55+ run : unzip release.zip
56+
6057 - name : Login to Azure
6158 uses : azure/login@v2
6259 with :
63- client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_B88D3C7A7060491CB674B14E06D42C55 }}
64- tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_78A8FAD52D144DAFB2B36B3D4D01B35C }}
65- subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_932529A45BB3430AA83B922DBBC83617 }}
66-
67- - name : ' Deploy to Azure Web App '
68- id : deploy-to-webapp
69- uses : azure/webapps- deploy@v3.0.1
70- with :
71- app-name : ' exprec '
72- slot -name : ' Production '
73- package : .
74-
60+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_B88D3C7A7060491CB674B14E06D42C55 }} # Use correct one
61+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_78A8FAD52D144DAFB2B36B3D4D01B35C }} # Use correct one
62+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_BB2D4206F5AC44CDA3289568B63A38F7 }} # Use correct one
63+ allow-no-subscriptions : true # Ensures login works even if no subscriptions are returned
64+
65+ - name : Deploy to Azure Web App
66+ id : deploy-to-webapp
67+ uses : azure/webapps-deploy@v3
68+ with :
69+ app -name : ' exprec '
70+ slot-name : ' Production '
71+ package : .
0 commit comments