Skip to content

Commit f53fef2

Browse files
committed
feat: Azure Function App deployment workflow
1 parent 19ce9f7 commit f53fef2

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/az_fnapp_deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Azure: Function App Deployment'
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
az-fnapp-deploy:
8+
name: "Azure: Build & Deploy Function App"
9+
runs-on: ubuntu-latest
10+
environment: ${{ github.event.pull_request.base.ref }}
11+
env:
12+
AZURE_FUNCTIONAPP_NAME: ${{ vars.AZURE_FUNCTIONAPP_NAME }}
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: ${{ vars.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
14+
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: 'true'
20+
21+
- name: Configure branch name
22+
id: branch_name
23+
run: echo "GH_REF_NAME=$(echo ${{ github.event.pull_request.head.ref }} | sed 's|/|-|g')" >> $GITHUB_OUTPUT
24+
25+
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: ${{ env.PYTHON_VERSION }}
29+
30+
- name: 'Resolve Project Dependencies Using Pip'
31+
shell: bash
32+
run: |
33+
pushd '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
36+
popd
37+
38+
- name: 'Run Azure Functions Action'
39+
uses: Azure/functions-action@v1
40+
with:
41+
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
42+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
43+
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
44+
scm-do-build-during-deployment: true
45+
enable-oryx-build: true

0 commit comments

Comments
 (0)