Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bef4c42

Browse filesBrowse files
authored
sample-commit
1 parent 2e75aef commit bef4c42
Copy full SHA for bef4c42

File tree

Expand file treeCollapse file tree

1 file changed

+73
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+73
-0
lines changed
Open diff view settings
Collapse file
+73Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow will build and push a Java application to an Azure Web App when a commit is pushed to your default branch.
2+
#
3+
# This workflow assumes you have already created the target Azure App Service web app.
4+
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-java?tabs=javase&pivots=platform-linux
5+
#
6+
# To configure this workflow:
7+
#
8+
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
9+
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
10+
#
11+
# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret.
12+
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
13+
#
14+
# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the JAVA_VERSION environment variable below.
15+
#
16+
# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions
17+
# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
18+
# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples
19+
20+
name: Build and deploy JAR app to Azure Web App
21+
22+
env:
23+
AZURE_WEBAPP_NAME: your-app-name # set this to the name of your Azure Web App
24+
JAVA_VERSION: '11' # set this to the Java version to use
25+
26+
on:
27+
push:
28+
branches:
29+
- master
30+
workflow_dispatch:
31+
32+
jobs:
33+
build:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
39+
- name: Set up Java version
40+
uses: actions/setup-java@v2.3.1
41+
with:
42+
java-version: ${{ env.JAVA_VERSION }}
43+
cache: 'maven'
44+
45+
- name: Build with Maven
46+
run: mvn clean install
47+
48+
- name: Upload artifact for deployment job
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: java-app
52+
path: '${{ github.workspace }}/target/*.jar'
53+
54+
deploy:
55+
runs-on: ubuntu-latest
56+
needs: build
57+
environment:
58+
name: 'Development'
59+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
60+
61+
steps:
62+
- name: Download artifact from build job
63+
uses: actions/download-artifact@v2
64+
with:
65+
name: java-app
66+
67+
- name: Deploy to Azure Web App
68+
id: deploy-to-webapp
69+
uses: azure/webapps-deploy@v2
70+
with:
71+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
72+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
73+
package: '*.jar'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.