Skip to content

Update main_vets-ai-bthnchcjenfbbfbb.yml #5

Update main_vets-ai-bthnchcjenfbbfbb.yml

Update main_vets-ai-bthnchcjenfbbfbb.yml #5

name: Build and deploy Python app to Azure Web App - vets-ai-bthnchcjenfbbfbb
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python version
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
- name: Zip artifact for deployment
run: zip release.zip ./* -r
- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v4
with:
name: python-app
path: |
release.zip
!venv/
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: python-app
- name: Unzip artifact for deployment
run: unzip release.zip
# Use either Login to Azure with a Service Principal or a Publish Profile below:
# Option 1: Login to Azure with Service Principal
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_7426045762884A46B2C32146614BC49D }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C72663B1D57841BCA0661A1AA7305062 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E92F13266520462ABA4F2DE624F99935 }}
# Option 2: Use Publish Profile for simpler auth
# - name: 'Deploy to Azure Web App'
# uses: azure/webapps-deploy@v3
# with:
# app-name: 'vets-ai'
# publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
# slot-name: 'Production'
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'vets-ai' # Corrected name
slot-name: 'Production'