File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Python project to Azure Function App
2+
3+ on :
4+ [push]
5+
6+ env :
7+ AZURE_FUNCTIONAPP_NAME : ' fastapi-demo' # set this to your function app name on Azure
8+ AZURE_FUNCTIONAPP_PACKAGE_PATH : ' .' # set this to the path to your function app project, defaults to the repository root
9+ PYTHON_VERSION : ' 3.11' # set this to the python version to use (e.g. '3.6', '3.7', '3.8')
10+
11+ jobs :
12+ build-and-deploy :
13+ runs-on : ubuntu-latest
14+ environment : dev
15+ steps :
16+ - name : ' Checkout GitHub Action'
17+ uses : actions/checkout@v3
18+
19+ - name : Setup Python ${{ env.PYTHON_VERSION }} Environment
20+ uses : actions/setup-python@v4
21+ with :
22+ python-version : ${{ env.PYTHON_VERSION }}
23+
24+ - name : ' Resolve Project Dependencies Using Pip'
25+ shell : bash
26+ run : |
27+ pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
28+ python -m pip install --upgrade pip
29+ pip install -r requirements.txt --target=".python_packages/lib/site-packages"
30+ popd
31+
32+ - name : ' Run Azure Functions Action'
33+ uses : Azure/functions-action@v1
34+ id : fa
35+ with :
36+ app-name : ${{ env.AZURE_FUNCTIONAPP_NAME }}
37+ package : ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
38+ publish-profile : ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
39+ scm-do-build-during-deployment : true
40+ enable-oryx-build : true
You can’t perform that action at this time.
0 commit comments