forked from Azure/actions-workflow-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows-java-functionapp-on-azure.yml
55 lines (50 loc) · 2.03 KB
/
windows-java-functionapp-on-azure.yml
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
50
51
52
53
54
55
# Action Requires
# 1. Setup the AZURE_CREDENTIALS secrets in your Github Repository by following README.md
# 2. Replace PLEASE_REPLACE_THIS_WITH_YOUR_FUNCTION_APP_NAME with your Azure function app name
# 3. Replace POM_ARTIFACT_ID with the value in project <artifactId> in pom.xml
# 4. Replace POM_FUNCTION_APP_NAME with the value in properties <functionAppName> in pom.xml
# 5. Add this yaml file to your project's .github/workflows/
# 6. Push your local project to your Github Repository
name: Windows_Java_Workflow
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: 'Login via Azure CLI'
uses: Azure/actions/login@master
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup Java 1.8.x
uses: actions/setup-java@v1
with:
# If your pom.xml <maven.compiler.source> version is not in 1.8.x
# Please change the Java version to match the version in pom.xml <maven.compiler.source>
java-version: '1.8.x'
- name: 'Run mvn'
shell: pwsh
run: |
# If your function app project is not located in your repository's root
# Please change your directory for maven build in pushd
pushd ./POM_ARTIFACT_ID
mvn clean package
mvn azure-functions:package
popd
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: PLEASE_REPLACE_THIS_WITH_YOUR_FUNCTION_APP_NAME
# If your function app project is not located in your repository's root
# Please consider prefixing the project path in this package parameter
package: ./POM_ARTIFACT_ID/target/azure-functions/POM_FUNCTION_APP_NAME
#- name: 'use the published functionapp url in upcoming steps'
# run: |
# echo "${{ steps.fa.outputs.app-url }}"
# For more information on Github Actions:
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions