Skip to content

Update README.md

Update README.md #66

name: Build and deploy Python app to Azure Web App - ai-dslab-backend
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies from backend
run: pip install -r backend/requirements.txt
- name: Zip backend folder for deployment
run: |
cd backend
zip -r ../release.zip . -x "venv/*"
- name: Upload artifact for deployment
uses: actions/upload-artifact@v4
with:
name: python-app
path: release.zip
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write
contents: read
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
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1FAE509EB83D4609AE36AC7F0F996753 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_1CAD4C5815F74749A836FC494CB56088 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_BF92A8605B30418D89D037A4530EF5D2 }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'ai-dslab-backend'
slot-name: 'Production'
package: release.zip