Skip to content

Commit db060f7

Browse files
committed
action check
1 parent c97574f commit db060f7

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

0 commit comments

Comments
 (0)