File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy Node.js project to Azure Function App
1
+ name : Build and deploy the function app to Azure
2
2
3
3
on :
4
4
workflow_dispatch :
@@ -9,12 +9,15 @@ permissions:
9
9
10
10
env :
11
11
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 : ' .'
13
13
NODE_VERSION : ' 20.x'
14
14
15
15
jobs :
16
16
build-and-deploy :
17
17
runs-on : ubuntu-latest
18
+ defaults :
19
+ run :
20
+ working-directory : ${{ env.WORKING_DIRECTORY }}
18
21
environment : prod
19
22
steps :
20
23
- name : ' Checkout repo'
@@ -35,17 +38,15 @@ jobs:
35
38
- name : ' Build project'
36
39
shell : bash
37
40
run : |
38
- pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
39
41
npm ci
40
42
npm run build
41
43
npm run test --if-present
42
44
npm prune --omit=dev # Removes packages specified in devDependencies
43
- popd
44
45
45
- - name : ' Publish the package to Azure Function app'
46
+ - name : ' Publish the package to the Azure function app'
46
47
uses : Azure/functions-action@v1
47
48
id : fa
48
49
with :
49
50
app-name : ${{ env.AZURE_FUNCTIONAPP_NAME }}
50
- package : ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
51
+ package : ${{ env.WORKING_DIRECTORY }}
51
52
You can’t perform that action at this time.
0 commit comments