chore: prepare deployment
This commit is contained in:
parent
d417c84d77
commit
9a86921dd1
4 changed files with 121 additions and 0 deletions
70
.github/workflows/main_poweron-preprocessing.yml
vendored
Normal file
70
.github/workflows/main_poweron-preprocessing.yml
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
name: Build and deploy Python app to Azure Web App - poweron-preprocessing
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# ---------- BACKEND / PYTHON ----------
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
|
||||||
|
- 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: |
|
||||||
|
.
|
||||||
|
!venv/
|
||||||
|
!.venv/
|
||||||
|
!.git/
|
||||||
|
!.cache/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
permissions:
|
||||||
|
id-token: write # <-- required for OIDC
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download artifact from build job
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: python-app
|
||||||
|
|
||||||
|
- name: Login to Azure (OIDC)
|
||||||
|
uses: azure/login@v2
|
||||||
|
with:
|
||||||
|
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_AA4B9998A69E4C5C8FDF357E3FEAADD5 }}
|
||||||
|
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_CC57AD1F29D44DDA960AE3EAC6D2C27A }}
|
||||||
|
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4CD1D97C506D403E8E284466DB4E7898 }}
|
||||||
|
|
||||||
|
# Runtime env files (required in your setup)
|
||||||
|
- name: Set productive environment (runtime)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
cp env_prod.env .env
|
||||||
|
|
||||||
|
- name: Deploy to Azure Web App
|
||||||
|
uses: azure/webapps-deploy@v3
|
||||||
|
with:
|
||||||
|
app-name: "poweron-preprocessing"
|
||||||
|
slot-name: "Production"
|
||||||
|
package: . # reuse the downloaded artifact folder
|
||||||
|
# no publish-profile here; it will use the az login from azure/login
|
||||||
8
env_prod.env
Normal file
8
env_prod.env
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
PP_CONFIG_PATH="/Users/christopher/Documents/Repos/vo-customer-preprocessor/src/pp-config.yaml"
|
||||||
|
PP_API_KEY="kj823u90209mj020394jp2msakhfkjashjkf"
|
||||||
|
DB_ENDPOINT_API_KEY="ouho02j0rj2oijroi3rj2oijro23jr0990"
|
||||||
|
DB_URL="/Users/christopher/Documents/Repos/vo-customer-preprocessor/data/data_althaus.db"
|
||||||
|
POWERBI_DATASET_ID="0e72b1f1-3d32-4caa-bc1a-e523b6232343"
|
||||||
|
POWERBI_CLIENT_ID="9f6fa2cf-3fe1-4ed5-a430-bb7e408c0d87"
|
||||||
|
POWERBI_CLIENT_SECRET="Vdy8Q~Bm2_5ooy-pgYtEgvA9-LjRN2HiXFw6Ody0"
|
||||||
|
POWERBI_TENANT_ID="6a51aaeb-2467-4186-9504-2a05aedc591f"
|
||||||
42
requirements.txt
Normal file
42
requirements.txt
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
aiosqlite==0.21.0
|
||||||
|
annotated-types==0.7.0
|
||||||
|
anyio==4.11.0
|
||||||
|
certifi==2025.8.3
|
||||||
|
cffi==2.0.0
|
||||||
|
charset-normalizer==3.4.3
|
||||||
|
click==8.3.0
|
||||||
|
cryptography==46.0.1
|
||||||
|
fastapi==0.117.1
|
||||||
|
greenlet==3.2.4
|
||||||
|
h11==0.16.0
|
||||||
|
httpcore==1.0.9
|
||||||
|
httpx==0.28.1
|
||||||
|
idna==3.10
|
||||||
|
iniconfig==2.1.0
|
||||||
|
msal==1.34.0
|
||||||
|
numpy==2.3.3
|
||||||
|
packaging==25.0
|
||||||
|
pandas==2.3.2
|
||||||
|
pluggy==1.6.0
|
||||||
|
pycparser==2.23
|
||||||
|
pydantic==2.11.9
|
||||||
|
pydantic-core==2.33.2
|
||||||
|
pydantic-settings==2.10.1
|
||||||
|
pygments==2.19.2
|
||||||
|
pyjwt==2.10.1
|
||||||
|
pytest==8.4.2
|
||||||
|
pytest-asyncio==1.2.0
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
python-dotenv==1.1.1
|
||||||
|
pytz==2025.2
|
||||||
|
pyyaml==6.0.2
|
||||||
|
requests==2.32.5
|
||||||
|
six==1.17.0
|
||||||
|
sniffio==1.3.1
|
||||||
|
sqlalchemy==2.0.43
|
||||||
|
starlette==0.48.0
|
||||||
|
typing-extensions==4.15.0
|
||||||
|
typing-inspection==0.4.1
|
||||||
|
tzdata==2025.2
|
||||||
|
urllib3==2.5.0
|
||||||
|
uvicorn==0.37.0
|
||||||
1
startup.txt
Normal file
1
startup.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uvicorn app:app --host 0.0.0.0 --port 8000
|
||||||
Loading…
Reference in a new issue