-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (33 loc) · 1.19 KB
/
azure-functions-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deploy Azure Function App
on:
push:
branches:
- main # Trigger deployment on push to the main branch
workflow_dispatch: # Allow manual trigger from the Actions tab
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
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
- name: Activate virtual environment and install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to Azure Function App
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
scm-do-build-during-deployment: true
enable-oryx-build: true