Skip to content

Commit 7050f62

Browse files
Add or update the Azure App Service build and deployment workflow config
1 parent f20bae1 commit 7050f62

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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-boot-restful
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: '8'
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+
40+
steps:
41+
- name: Download artifact from build job
42+
uses: actions/download-artifact@v3
43+
with:
44+
name: java-app
45+
46+
- name: Deploy to Azure Web App
47+
id: deploy-to-webapp
48+
uses: azure/webapps-deploy@v2
49+
with:
50+
app-name: 'spring-boot-restful'
51+
slot-name: 'Production'
52+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D2F3B0F9498C426F851E30522F2E3E6E }}
53+
package: '*.jar'

0 commit comments

Comments
 (0)