File tree 1 file changed +71
-0
lines changed
1 file changed +71
-0
lines changed Original file line number Diff line number Diff line change
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 - airaccel
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - main
10
+ workflow_dispatch :
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : ubuntu-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 : Zip artifact for deployment
31
+ run : zip release.zip ./* -r
32
+
33
+ - name : Upload artifact for deployment job
34
+ uses : actions/upload-artifact@v4
35
+ with :
36
+ name : node-app
37
+ path : release.zip
38
+
39
+ deploy :
40
+ runs-on : ubuntu-latest
41
+ needs : build
42
+ environment :
43
+ name : ' Production'
44
+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
45
+ permissions :
46
+ id-token : write # This is required for requesting the JWT
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
+
57
+ - name : Login to Azure
58
+ uses : azure/login@v2
59
+ with :
60
+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_635DC9A2C2DF45D089067D0043494568 }}
61
+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_EC977203612148D6893ED9A8A4763933 }}
62
+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_08C5BC577DCE42BC9895277CDEEBA0D5 }}
63
+
64
+ - name : ' Deploy to Azure Web App'
65
+ id : deploy-to-webapp
66
+ uses : azure/webapps-deploy@v3
67
+ with :
68
+ app-name : ' airaccel'
69
+ slot-name : ' Production'
70
+ package : .
71
+
You can’t perform that action at this time.
0 commit comments