Skip to content

Merge pull request #6 from Aman123lug/Dev-patch-update #46

Merge pull request #6 from Aman123lug/Dev-patch-update

Merge pull request #6 from Aman123lug/Dev-patch-update #46

Workflow file for this run

name: MLOps-Pipeline-Started!
on:
push:
branches:
- main
workflow_run:
workflows:
- cml
jobs:
train-and-report:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Model Training
run: |
python src/dataIngestion.py
python src/preprocess.py
python src/train.py
echo "### Model Score" >> README.md
echo metrics.txt >> README.md
cml comment images/confusion_matrix.png --md >> README.md
continue-on-error: true
Docker-Automation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker Image Build
run: |
echo "${{ secrets.DOCKERPW }}" | docker login -u "krisharyan36" --password-stdin
docker image build -t krisharyan36/sdp:latest .
#docker image ls
docker push krisharyan36/sdp:latest
- name: Install OpenVPN
run: |
sudo apt update
sudo apt install -y openvpn openvpn-systemd-resolved
- name: Connect to VPN
uses: kota65535/github-openvpn-connect-action@v2
with:
config_file: .github/workflows/client.ovpn
username: ${{ secrets.OVPN_USERNAME }}
password: ${{ secrets.OVPN_PASSWORD }}
- name: Deploying SDP app in K8s Clusters
uses: appleboy/ssh-action@master
with:
proxy_host: ${{ secrets.SERVER_HOST }}
proxy_username: ${{ secrets.SERVER_USERNAME }}
proxy_password: ${{ secrets.SSH_PASSWORD }}
host: ${{ secrets.K3_SERVER_HOST }}
username: ${{ secrets.K3_SERVER_USERNAME }}
password: ${{ secrets.K3_SSH_PASSWORD }}
script: |
pwd
ls -lrth
kubectl delete deploy sdp-app -n mlops
kubectl apply -f /root/mlops/deployment.yaml