File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-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 JAR app to Azure Web App - staticodeanuj
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - master
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 Java version
20
+ uses : actions/setup-java@v4
21
+ with :
22
+ java-version : ' 8'
23
+ distribution : ' microsoft'
24
+
25
+ - name : Build with Maven
26
+ run : mvn clean install
27
+
28
+ - name : Upload artifact for deployment job
29
+ uses : actions/upload-artifact@v4
30
+ with :
31
+ name : java-app
32
+ path : ' ${{ github.workspace }}/target/*.jar'
33
+
34
+ deploy :
35
+ runs-on : ubuntu-latest
36
+ needs : build
37
+ environment :
38
+ name : ' Production'
39
+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
40
+ permissions :
41
+ id-token : write # This is required for requesting the JWT
42
+
43
+ steps :
44
+ - name : Download artifact from build job
45
+ uses : actions/download-artifact@v4
46
+ with :
47
+ name : java-app
48
+
49
+ - name : Login to Azure
50
+ uses : azure/login@v2
51
+ with :
52
+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_0B0CCE117B164262B2EF4166F0AB93CC }}
53
+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_18CF140AEFB5476A91ED3E86B64AA3E6 }}
54
+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_FFA3C5C98AF24B1391F46D2CEC1A7677 }}
55
+
56
+ - name : Deploy to Azure Web App
57
+ id : deploy-to-webapp
58
+ uses : azure/webapps-deploy@v3
59
+ with :
60
+ app-name : ' staticodeanuj'
61
+ slot-name : ' Production'
62
+ package : ' *.jar'
63
+
You can’t perform that action at this time.
0 commit comments