Skip to content
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Java project to Azure Function App - functional-org-baloise
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: functional-org-baloise # set this to your function app name on Azure
PACKAGE_DIRECTORY: '.' # set this to the directory which contains pom.xml file
JAVA_VERSION: '17' # set this to the java version to use
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v2
- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: 'Restore Project Dependencies Using Mvn'
shell: pwsh
run: |
pushd './${{ env.PACKAGE_DIRECTORY }}'
mvn clean package
popd
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'functional-org-baloise'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_99216940561B45F6BA7ED1FC8AF6D8B4 }}
package: '${{ env.PACKAGE_DIRECTORY }}'
respect-pom-xml: true