From 40fc3db398278618664d8afc9e414536af732f6f Mon Sep 17 00:00:00 2001 From: Christopher Gondek Date: Mon, 3 Nov 2025 12:19:58 +0100 Subject: [PATCH] chore: update althaus deploy yml --- .../main_poweron-althaus-preprocess-prod.yml | 75 ++++++++----------- 1 file changed, 31 insertions(+), 44 deletions(-) diff --git a/.github/workflows/main_poweron-althaus-preprocess-prod.yml b/.github/workflows/main_poweron-althaus-preprocess-prod.yml index 6417b80..2d1e361 100644 --- a/.github/workflows/main_poweron-althaus-preprocess-prod.yml +++ b/.github/workflows/main_poweron-althaus-preprocess-prod.yml @@ -1,76 +1,63 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# 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 +name: Build and deploy Python app to Azure Web App - althaus-preprocessing on: push: - branches: - - main + branches: [main] workflow_dispatch: jobs: build: runs-on: ubuntu-latest permissions: - contents: read #This is required for actions/checkout - + contents: read 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 with: - python-version: '3.11' + python-version: "3.13" - # 🛠️ Local Build Section (Optional) - # 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. - - name: Create and Start virtual environment and Install dependencies - run: | - 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: Install uv + uses: astral-sh/setup-uv@v6 + + # ---------- ARTIFACT ---------- - name: Upload artifact for deployment jobs uses: actions/upload-artifact@v4 with: name: python-app path: | . - !antenv/ - - # 🚫 Opting Out of Oryx Build - # If you prefer to disable the Oryx build process during deployment, follow these steps: - # 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 - + !venv/ + !.venv/ + !.git/ + !.cache/ deploy: runs-on: ubuntu-latest needs: build - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + permissions: + id-token: write + contents: read steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: 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' - uses: azure/webapps-deploy@v3 - id: deploy-to-webapp + - name: Login to Azure (OIDC) + uses: azure/login@v2 with: - app-name: 'poweron-althaus-preprocess-prod' - slot-name: 'Production' - \ No newline at end of file + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3720212D35D047C38CEE2F365F1D81C7 }} + 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