-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.57 KB
/
cicd-java-webapp-v2.yml
File metadata and controls
49 lines (40 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: CI/CD Java War package to Azure Web App
on: workflow_dispatch
# CONFIGURATION
# For help, go to https://github.com/Azure/Actions
#
# 1. Set up the following secrets in your repository:
# AZURE_WEBAPP_PUBLISH_PROFILE
#
# 2. Change these variables for your configuration:
env:
AZURE_WEBAPP_NAME: oa-poc-javawebapp # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: ${{ github.workspace }} # set this to the path to your web app project
JAVA_VERSION: '11' # set this to the java version to use
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # set GH repo secret with the publish profile of the web app
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
environment: PoC-AppService
steps:
- uses: actions/checkout@master
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Build with Maven
run: mvn clean install
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: java-webapp.war
path: '${{ github.workspace }}/target/*.war'
- name: 'List WAR'
run: ls -l ${{ github.workspace }}/target/*.*
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/target/AirlinesReservationSample-0.0.1-SNAPSHOT.war'