Merge pull request #7 from valueonag/feat/update-althaus-yml

chore: update althaus deploy yml
This commit is contained in:
Christopher Gondek 2025-11-03 12:26:15 +01:00 committed by GitHub
commit 837e0c1d29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,76 +1,63 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy name: Build and deploy Python app to Azure Web App - althaus-preprocessing
# More GitHub Actions for Azure: https://github.com/Azure/actions
# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
name: Build and deploy Python app to Azure Web App - poweron-althaus-preprocess-prod
on: on:
push: push:
branches: branches: [main]
- main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read #This is required for actions/checkout contents: read
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
uses: actions/checkout@v4
- name: Set up Python version # ---------- BACKEND / PYTHON ----------
- name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.11' python-version: "3.13"
# 🛠️ Local Build Section (Optional) - name: Install uv
# 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. uses: astral-sh/setup-uv@v6
- name: Create and Start virtual environment and Install dependencies
run: | # ---------- ARTIFACT ----------
python -m venv antenv
source antenv/bin/activate
pip install -r requirements.txt
# 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.
- name: Upload artifact for deployment jobs - name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: python-app name: python-app
path: | path: |
. .
!antenv/ !venv/
!.venv/
# 🚫 Opting Out of Oryx Build !.git/
# If you prefer to disable the Oryx build process during deployment, follow these steps: !.cache/
# 1. Remove the SCM_DO_BUILD_DURING_DEPLOYMENT app setting from your Azure App Service Environment variables.
# 2. Refer to sample workflows for alternative deployment strategies: https://github.com/Azure/actions-workflow-samples/tree/master/AppService
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
permissions: permissions:
id-token: write #This is required for requesting the JWT id-token: write
contents: read #This is required for actions/checkout contents: read
steps: steps:
- name: Download artifact from build job - name: Download artifact from build job
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: python-app name: python-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3720212D35D047C38CEE2F365F1D81C7 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_AC3FDD6C7376466AA44A309428618439 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_94A2088C685A46DFAE2BFBA50714B1DA }}
- name: 'Deploy to Azure Web App' - name: Login to Azure (OIDC)
uses: azure/webapps-deploy@v3 uses: azure/login@v2
id: deploy-to-webapp
with: with:
app-name: 'poweron-althaus-preprocess-prod' client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3720212D35D047C38CEE2F365F1D81C7 }}
slot-name: 'Production' tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_AC3FDD6C7376466AA44A309428618439 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_94A2088C685A46DFAE2BFBA50714B1DA }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: "poweron-althaus-preprocess-prod"
slot-name: "Production"
package: . # reuse the downloaded artifact folder