updated permissions for the workflow #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ML Ops Workflow | |
on: [push] | |
env: | |
workspace-name: aml-ws-mlops | |
resource-group: rg-mlops | |
sub-id: 20671c75-cecd-4a9d-9dfb-98defacfaec2 | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: dev | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./ml/requirements.txt | |
- name: "Az CLI login" | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Set up Azure Machine Learning | |
run: | | |
az extension add -n azure-cli-ml | |
- name: Upload dataset | |
run: | | |
az ml dataset create -f ./ml/data.yaml --workspace-name ${{ env.workspace-name }} --resource-group ${{ env.resource-group }} | |
- name: Submit training run | |
run: | | |
az ml job create --file ./ml/train.yaml --workspace-name ${{ env.workspace-name }} --resource-group ${{ env.resource-group }} | |
# - name: Register the model | |
# run: | | |
# az ml job create --file register_model.yaml | |
# - name: Deploy the model | |
# run: | | |
# az ml job create --file deploy_model.yaml | |
# - name: Test the deployment | |
# run: | | |
# python test_deployment.py |