fix: use Oryx server-side build instead of pre-bundled packages

The previous workflow installed dependencies with pip --target and zipped
them into the deployment package. Azure Oryx runtime could not find
the packages because it looks for antenv/ or __oryx_packages__/, not
.python_packages/. Switch to deploying source-only zip with az webapp
deploy, letting SCM_DO_BUILD_DURING_DEPLOYMENT=true trigger Oryx to
run pip install on the server and create the antenv virtualenv.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gongzhiyong
2026-04-08 13:51:25 +08:00
co-authored by Claude Opus 4.6
parent f4d3e1655a
commit f2f6efd0ff
+9 -12
View File
@@ -20,16 +20,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Create deployment package
run: |
cd backend
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
zip -r ../deploy.zip . -x ".venv/*" ".env" "__pycache__/*" "*.pyc"
zip -r ../deploy.zip . -x ".venv/*" ".env" "__pycache__/*" "*.pyc" ".git/*" "tests/*"
- name: Login to Azure
uses: azure/login@v2
@@ -38,8 +32,11 @@ jobs:
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_62D66D4E65AC4A6C872064AD668AC691 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5D7B0564A55F4209A91149F2642D3F69 }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: soc-backend
package: deploy.zip
- name: Deploy to Azure Web App (Oryx build)
run: |
az webapp deploy \
--name soc-backend \
--resource-group Operation \
--src-path deploy.zip \
--type zip \
--async false