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 - jaiwebapp01
5+ 6+ on :
7+ push :
8+ branches :
9+ - master
10+ workflow_dispatch :
11+ 12+ jobs :
13+ build :
14+ runs-on : windows-latest
15+ 16+ steps :
17+ - uses : actions/checkout@v4
18+ 19+ - name : Set up Node.js version
20+ uses : actions/setup-node@v3
21+ with :
22+ node-version : ' 20.x'
23+ 24+ - name : npm install, build, and test
25+ run : |
26+ npm install
27+ npm run build --if-present
28+ npm run test --if-present
29+
30+ - name : Upload artifact for deployment job
31+ uses : actions/upload-artifact@v4
32+ with :
33+ name : node-app
34+ path : .
35+ 36+ deploy :
37+ runs-on : ubuntu-latest
38+ needs : build
39+ environment :
40+ name : ' Production'
41+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
42+ permissions :
43+ id-token : write # This is required for requesting the JWT
44+ 45+ steps :
46+ - name : Download artifact from build job
47+ uses : actions/download-artifact@v4
48+ with :
49+ name : node-app
50+ 51+ - name : Login to Azure
52+ uses : azure/login@v2
53+ with :
54+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_985FDEE50E644D6BBC512A27B6FB1933 }}
55+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_BE2305F152104A9991214C67EB41F48B }}
56+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_91C2F0467BDD4B2D9A54734CCE93649E }}
57+ 58+ - name : ' Deploy to Azure Web App'
59+ uses : azure/webapps-deploy@v3
60+ id : deploy-to-webapp
61+ with :
62+ app-name : ' jaiwebapp01'
63+ slot-name : ' Production'
64+ package : .
65+
0 commit comments