From 8ff4c07bf2ea8b128d57e8afdb82276fd97461fc Mon Sep 17 00:00:00 2001 From: Yvand Date: Mon, 20 Jan 2025 11:36:40 +0100 Subject: [PATCH] update workflow --- .github/workflows/azure-functions-app-nodejs.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/azure-functions-app-nodejs.yml b/.github/workflows/azure-functions-app-nodejs.yml index fc5d07b..4c61d56 100644 --- a/.github/workflows/azure-functions-app-nodejs.yml +++ b/.github/workflows/azure-functions-app-nodejs.yml @@ -1,4 +1,4 @@ -name: Deploy Node.js project to Azure Function App +name: Build and deploy the function app to Azure on: workflow_dispatch: @@ -9,12 +9,15 @@ permissions: env: AZURE_FUNCTIONAPP_NAME: ${{ vars.AZURE_FUNCTIONAPP_NAME }} - AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root + WORKING_DIRECTORY: '.' NODE_VERSION: '20.x' jobs: build-and-deploy: runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ env.WORKING_DIRECTORY }} environment: prod steps: - name: 'Checkout repo' @@ -35,17 +38,15 @@ jobs: - name: 'Build project' shell: bash run: | - pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' npm ci npm run build npm run test --if-present npm prune --omit=dev # Removes packages specified in devDependencies - popd - - name: 'Publish the package to Azure Function app' + - name: 'Publish the package to the Azure function app' uses: Azure/functions-action@v1 id: fa with: app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} - package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} + package: ${{ env.WORKING_DIRECTORY }}