User Tools

Site Tools


wiki:ai:github-actions-azure-pipeline

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:ai:github-actions-azure-pipeline [2025/06/19 21:36] ddehamerwiki:ai:github-actions-azure-pipeline [2025/06/20 14:58] (current) ddehamer
Line 80: Line 80:
  
 ====== Github Pipeline Test ====== ====== Github Pipeline Test ======
 +
 +Git files: {{ :wiki:ai:ml-cicd-demo.zip |}}
 +
 +Have it on my repo:  [[https://github.com/ddehamer/ml-cicd-demo.git]]
 +
 +Actions Secrets:
 +
 +{{:wiki:ai:screenshot_2025-06-19_at_5.39.54 pm.png?600|}}
  
 ===== Final Working Commands ===== ===== Final Working Commands =====
Line 171: Line 179:
   --resource-group don-test-rg \   --resource-group don-test-rg \
   --workspace-name don-ml-workspace   --workspace-name don-ml-workspace
-</code>%+</code>
  
 ====== Final Working Files ====== ====== Final Working Files ======
Line 326: Line 334:
 joblib.dump(clf, "outputs/model.joblib") joblib.dump(clf, "outputs/model.joblib")
 print("✅ Model saved to ./outputs/model.joblib") print("✅ Model saved to ./outputs/model.joblib")
 +</code>
 +
 +<code - .github/workflows/train-deploy.yml>
 +name: Train and Register Model in Azure ML
 +
 +on:
 +  push:
 +    branches: [ main ]
 +
 +jobs:
 +  train-register:
 +    runs-on: ubuntu-latest
 +
 +    env:
 +      AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
 +      AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
 +      AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
 +      AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
 +      AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
 +      AZURE_WORKSPACE_NAME: ${{ secrets.AZURE_WORKSPACE_NAME }}
 +
 +    steps:
 +      - name: ✅ Checkout code
 +        uses: actions/checkout@v4
 +
 +      - name: 🔐 Login to Azure
 +        uses: azure/login@v1
 +        with:
 +          creds: ${{ secrets.AZURE_CREDENTIALS }}
 +
 +      - name: 🐍 Set up Python
 +        uses: actions/setup-python@v5
 +        with:
 +          python-version: '3.10'
 +
 +      - name: 📦 Install dependencies
 +        run: |
 +          python -m pip install --upgrade pip
 +          pip install -r requirements.txt
 +          az extension add -n ml -y
 +
 +      - name: 🚀 Submit Azure ML pipeline job
 +        run: |
 +          az ml job create \
 +            --file pipeline-job.yml \
 +            --resource-group $AZURE_RESOURCE_GROUP \
 +            --workspace-name $AZURE_WORKSPACE_NAME
 </code> </code>
  
wiki/ai/github-actions-azure-pipeline.1750368996.txt.gz · Last modified: by ddehamer