Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 47 additions & 20 deletions .github/workflows/mlops.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,60 @@
name: Diabetes Prediction Workflow

on:
push:
branches:
- main

env:
RESOURCE_GROUP: my-resource-group
WORKSPACE_NAME: my-workspace
REQUIREMENTS_PATH: 'path/to/requirements.txt' # Change this to the path of your requirements.txt file

jobs:
experiment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Azure Machine Learning
uses: azure/setup-aci@v1
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group: my-resource-group
workspace-name: my-workspace
- name: Train model in development environment
run: |
python train.py diabetes-dev-folder
- uses: actions/checkout@v2

- name: Set up Python Environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r ${{ env.REQUIREMENTS_PATH }}

- name: Setup Azure Machine Learning
uses: azure/setup-aml-workspace@v1 # This is a hypothetical action for AML; replace with a suitable one
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group: ${{ env.RESOURCE_GROUP }}
workspace-name: ${{ env.WORKSPACE_NAME }}

- name: Train model in development environment
run: |
source venv/bin/activate
python train.py diabetes-dev-folder

production:
needs: experiment
environment: production # Assumes you've set up an environment in GitHub named 'production' with protection rules for approvals
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Azure Machine Learning
uses: azure/setup-aci@v1
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group: my-resource-group
workspace-name: my-workspace
- name: Train model in production environment
run: |
python train.py diabetes-prod-folder
- uses: actions/checkout@v2

- name: Set up Python Environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r ${{ env.REQUIREMENTS_PATH }}

- name: Setup Azure Machine Learning
uses: azure/setup-aml-workspace@v1 # This is a hypothetical action for AML; replace with a suitable one
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group: ${{ env.RESOURCE_GROUP }}
workspace-name: ${{ env.WORKSPACE_NAME }}

- name: Train model in production environment
run: |
source venv/bin/activate
python train.py diabetes-prod-folder