Update main_tbapachefop(staging).yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Java project to Azure Function App | |
on: | |
[push] | |
# CONFIGURATION | |
# For help, go to https://github.com/Azure/Actions | |
# | |
# 1. Set up the following secrets in your repository: | |
# AZURE_FUNCTIONAPP_PUBLISH_PROFILE | |
# | |
# 2. Change these variables for your configuration: | |
env: | |
AZURE_FUNCTIONAPP_NAME: 'tbapachefop' # set this to your function app name on Azure | |
POM_XML_DIRECTORY: './apachefop-serverless-az-func' # set this to the directory which contains pom.xml file | |
JAVA_VERSION: '11' # set this to the java version to use (e.g. '8', '11', '17') | |
jobs: | |
build-and-deploy: | |
runs-on: windows-latest | |
environment: dev | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v3 | |
- 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.POM_XML_DIRECTORY }}' | |
mvn clean package | |
popd | |
- name: 'Run Azure Functions Action' | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
slot-name: Staging | |
package: '${{ env.POM_XML_DIRECTORY }}' # if there are multiple function apps in same project, then this path will be like './${{ env.POM_XML_DIRECTORY }}/target/azure-functions/${{ env.POM_FUNCTIONAPP_NAME }' | |
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} | |
respect-pom-xml: true | |
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples |