-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.49 KB
/
azure-functions.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
44
45
46
# This workflow will build a Python app and deploy it to an Azure Functions App on Linux when a commit is pushed to your default branch.
name: Deploy Azure Function App
on:
push:
branches: ["azure-production"]
paths:
- Azure Functions/<PATH>/** # set this to your function app path
env:
AZURE_FUNCTIONAPP_NAME: '<FUNCTION_NAME>' # set this to your function app name on Azure
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'Azure Functions/<PATH>/' # set this to your function app path
PYTHON_VERSION: '3.11'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: dev
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- 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: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.<PUBLISH_PROFILE> }} # set this to your publish profile on Azure
scm-do-build-during-deployment: true
enable-oryx-build: true