Skip to content

Commit ee0d68d

Browse files
2 parents 127039b + 808dac1 commit ee0d68d

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 - springboot-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_2D58F0F7208140CBBAF6B82E3A126946 }}
52+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6C60C8B3AFB84CC58D36A419352CEC54 }}
53+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F904609B97C04D1DBDD8A1832D0FFC71 }}
54+
55+
- name: Deploy to Azure Web App
56+
id: deploy-to-webapp
57+
uses: azure/webapps-deploy@v2
58+
with:
59+
app-name: 'springboot-api-helpdesk'
60+
slot-name: 'Production'
61+
package: '*.jar'
62+

0 commit comments

Comments
 (0)