From 59b0dd8182819961afc13d103718540dcd6b61f7 Mon Sep 17 00:00:00 2001 From: LarryDavidJr Date: Wed, 10 Apr 2024 12:36:36 +0100 Subject: [PATCH] Add or update the Azure App Service build and deployment workflow config --- .../workflows/main_tbapachefop(staging).yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/main_tbapachefop(staging).yml diff --git a/.github/workflows/main_tbapachefop(staging).yml b/.github/workflows/main_tbapachefop(staging).yml new file mode 100644 index 0000000..c8bffb6 --- /dev/null +++ b/.github/workflows/main_tbapachefop(staging).yml @@ -0,0 +1,54 @@ +# 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 + \ No newline at end of file