Skip to content

Commit dd5bd66

Browse files
committed
action check
1 parent e40c811 commit dd5bd66

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Diff for: .github/workflows/azure-functions-deploy.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
- main # Trigger deployment on push to the main branch
77
workflow_dispatch: # Allow manual trigger from the Actions tab
88

9+
env:
10+
# set this to your function app name on Azure
11+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root
12+
PYTHON_VERSION: '3.10'
13+
914
jobs:
1015
build-and-deploy:
1116
runs-on: ubuntu-latest
@@ -14,20 +19,18 @@ jobs:
1419
- name: Checkout repository
1520
uses: actions/checkout@v2
1621

17-
- name: Set up Python
22+
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
1823
uses: actions/setup-python@v4
1924
with:
20-
python-version: '3.10' # Specify the Python version
21-
22-
- name: Create virtual environment
23-
run: python3 -m venv .azure_function_fastapi_venv
25+
python-version: ${{ env.PYTHON_VERSION }}
2426

25-
- name: Activate virtual environment and install dependencies
27+
- name: 'Resolve Project Dependencies Using Pip'
28+
shell: bash
2629
run: |
27-
30+
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
2831
python -m pip install --upgrade pip
2932
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
30-
33+
popd
3134
3235
- name: Azure Login
3336
uses: azure/login@v1
@@ -38,6 +41,7 @@ jobs:
3841
uses: azure/functions-action@v1
3942
with:
4043
app-name: ${{ secrets.PROJECT_NAME }} # Replace with your Function App name
41-
package: '.' # Specify the directory to deploy, usually the current directory
44+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
45+
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
4246
scm-do-build-during-deployment: true
4347
enable-oryx-build: true

Diff for: fastapi_project/api/root_index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@router.get("/")
99
async def root_index(request: Request):
1010
data = {
11-
'message': 'azure function project is running.'
11+
'message': 'azure function project is running.now'
1212
}
1313
return JSONResponse(content=data, status_code=status.HTTP_200_OK)
1414

0 commit comments

Comments
 (0)