Skip to content

Commit

Permalink
action check
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed May 18, 2024
1 parent e40c811 commit dd5bd66
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/azure-functions-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- main # Trigger deployment on push to the main branch
workflow_dispatch: # Allow manual trigger from the Actions tab

env:
# set this to your function app name on Azure
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root
PYTHON_VERSION: '3.10'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand All @@ -14,20 +19,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
uses: actions/setup-python@v4
with:
python-version: '3.10' # Specify the Python version

- name: Create virtual environment
run: python3 -m venv .azure_function_fastapi_venv
python-version: ${{ env.PYTHON_VERSION }}

- name: Activate virtual environment and install dependencies
- name: 'Resolve Project Dependencies Using Pip'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
python -m pip install --upgrade pip
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
popd
- name: Azure Login
uses: azure/login@v1
Expand All @@ -38,6 +41,7 @@ jobs:
uses: azure/functions-action@v1
with:
app-name: ${{ secrets.PROJECT_NAME }} # Replace with your Function App name
package: '.' # Specify the directory to deploy, usually the current directory
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
scm-do-build-during-deployment: true
enable-oryx-build: true
2 changes: 1 addition & 1 deletion fastapi_project/api/root_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@router.get("/")
async def root_index(request: Request):
data = {
'message': 'azure function project is running.'
'message': 'azure function project is running.now'
}
return JSONResponse(content=data, status_code=status.HTTP_200_OK)

0 comments on commit dd5bd66

Please sign in to comment.