You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2
+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3
+
# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
4
+
5
+
name: Build and deploy Python app to Azure Web App - testwebappforgithub
6
+
7
+
on:
8
+
push:
9
+
branches:
10
+
- main
11
+
workflow_dispatch:
12
+
13
+
jobs:
14
+
build:
15
+
runs-on: ubuntu-latest
16
+
permissions:
17
+
contents: read #This is required for actions/checkout
18
+
19
+
steps:
20
+
- uses: actions/checkout@v4
21
+
22
+
- name: Set up Python version
23
+
uses: actions/setup-python@v5
24
+
with:
25
+
python-version: '3.13'
26
+
27
+
# 🛠️ Local Build Section (Optional)
28
+
# The following section in your workflow is designed to catch build issues early on the client side, before deployment. This can be helpful for debugging and validation. However, if this step significantly increases deployment time and early detection is not critical for your workflow, you may remove this section to streamline the deployment process.
29
+
- name: Create and Start virtual environment and Install dependencies
30
+
run: |
31
+
python -m venv antenv
32
+
source antenv/bin/activate
33
+
pip install -r requirements.txt
34
+
35
+
# By default, when you enable GitHub CI/CD integration through the Azure portal, the platform automatically sets the SCM_DO_BUILD_DURING_DEPLOYMENT application setting to true. This triggers the use of Oryx, a build engine that handles application compilation and dependency installation (e.g., pip install) directly on the platform during deployment. Hence, we exclude the antenv virtual environment directory from the deployment artifact to reduce the payload size.
36
+
- name: Upload artifact for deployment jobs
37
+
uses: actions/upload-artifact@v4
38
+
with:
39
+
name: python-app
40
+
path: |
41
+
.
42
+
!antenv/
43
+
44
+
# 🚫 Opting Out of Oryx Build
45
+
# If you prefer to disable the Oryx build process during deployment, follow these steps:
46
+
# 1. Remove the SCM_DO_BUILD_DURING_DEPLOYMENT app setting from your Azure App Service Environment variables.
47
+
# 2. Refer to sample workflows for alternative deployment strategies: https://github.com/Azure/actions-workflow-samples/tree/master/AppService
48
+
49
+
50
+
deploy:
51
+
runs-on: ubuntu-latest
52
+
needs: build
53
+
permissions:
54
+
id-token: write #This is required for requesting the JWT
55
+
contents: read #This is required for actions/checkout
0 commit comments