Skip to content

Commit 8ff4c07

Browse files
committed
update workflow
1 parent 51edb35 commit 8ff4c07

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/azure-functions-app-nodejs.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Node.js project to Azure Function App
1+
name: Build and deploy the function app to Azure
22

33
on:
44
workflow_dispatch:
@@ -9,12 +9,15 @@ permissions:
99

1010
env:
1111
AZURE_FUNCTIONAPP_NAME: ${{ vars.AZURE_FUNCTIONAPP_NAME }}
12-
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root
12+
WORKING_DIRECTORY: '.'
1313
NODE_VERSION: '20.x'
1414

1515
jobs:
1616
build-and-deploy:
1717
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: ${{ env.WORKING_DIRECTORY }}
1821
environment: prod
1922
steps:
2023
- name: 'Checkout repo'
@@ -35,17 +38,15 @@ jobs:
3538
- name: 'Build project'
3639
shell: bash
3740
run: |
38-
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
3941
npm ci
4042
npm run build
4143
npm run test --if-present
4244
npm prune --omit=dev # Removes packages specified in devDependencies
43-
popd
4445
45-
- name: 'Publish the package to Azure Function app'
46+
- name: 'Publish the package to the Azure function app'
4647
uses: Azure/functions-action@v1
4748
id: fa
4849
with:
4950
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
50-
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
51+
package: ${{ env.WORKING_DIRECTORY }}
5152

0 commit comments

Comments
 (0)