Skip to content

Fix XGBoost early stopping error in RandomizedSearchCV - remove early… #5

Fix XGBoost early stopping error in RandomizedSearchCV - remove early…

Fix XGBoost early stopping error in RandomizedSearchCV - remove early… #5

Workflow file for this run

name: Build and Deploy to Azure
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DOCKER_IMAGE: fraud-detection
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run tests
run: pytest tests/unit/test_core_logic.py -v
build-and-deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Login to ACR
uses: docker/login-action@v3
with:
registry: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.ACR_LOGIN_SERVER }}/${{ env.DOCKER_IMAGE }}:${{ github.sha }}
${{ secrets.ACR_LOGIN_SERVER }}/${{ env.DOCKER_IMAGE }}:latest
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
images: ${{ secrets.ACR_LOGIN_SERVER }}/${{ env.DOCKER_IMAGE }}:${{ github.sha }}