File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Azure Function
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ workflow_dispatch :
7+
8+ env :
9+ # Replace the value below with the name of your pre-created function app
10+ # (find it in the Azure Portal, e.g. carvedrock-func-xxxxxxxx).
11+ AZURE_FUNCTIONAPP_NAME : REPLACE_WITH_YOUR_FUNCTION_APP_NAME
12+ AZURE_FUNCTIONAPP_PACKAGE_PATH : ' .'
13+ NODE_VERSION : ' 20.x'
14+
15+ jobs :
16+ build-and-deploy :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Check out repository
20+ uses : actions/checkout@v4
21+
22+ - name : Set up Node ${{ env.NODE_VERSION }}
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ${{ env.NODE_VERSION }}
26+
27+ - name : Install dependencies (build and package)
28+ shell : bash
29+ run : |
30+ pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
31+ npm install --if-present
32+ popd
33+
34+ - name : Deploy to Azure Functions
35+ uses : Azure/functions-action@v1
36+ with :
37+ app-name : ${{ env.AZURE_FUNCTIONAPP_NAME }}
38+ package : ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
39+ publish-profile : ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
You can’t perform that action at this time.
0 commit comments