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