Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Jan 20, 2025
1 parent 51edb35 commit 8ff4c07
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/azure-functions-app-nodejs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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'
Expand All @@ -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 }}

0 comments on commit 8ff4c07

Please sign in to comment.