Skip to content

Add or update the Azure App Service build and deployment workflow config #1

Add or update the Azure App Service build and deployment workflow config

Add or update the Azure App Service build and deployment workflow config #1

# 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 - tbapachefop
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: tbapachefop # set this to your function app name on Azure
PACKAGE_DIRECTORY: '.' # set this to the directory which contains pom.xml file
JAVA_VERSION: '11' # set this to the java version to use
jobs:
build-and-deploy:
runs-on: windows-latest
permissions:
id-token: write #This is required for requesting the JWT
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- 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: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_9674DC3E1D104C88975E845D327F6417 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_202A0E757ED6477EB3FAAAB9E05DEE55 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E3BDFC0A5403499B89C1800AE18880AD }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'tbapachefop'
slot-name: 'Staging'
package: '${{ env.PACKAGE_DIRECTORY }}'
respect-pom-xml: true