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 - doky-another-test
on:
push:
branches:
- DOKY-191-Create-Azure-Function-to-cleanup-expired-reset-password-tokens
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: doky-another-test # 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
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@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_45E24C534FA349AC80562B9C627320EA }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_B17E423775E94F28A31693F8475E2140 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_1873879B940042D9A96DA32930487DDF }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'doky-another-test'
slot-name: 'Production'
package: '${{ env.PACKAGE_DIRECTORY }}'
respect-pom-xml: true