Update cml.yml #36
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: MLOps-Pipeline-Started! | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
train-and-report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Model Training | |
env: | |
REPO_TOKEN: ${{ secrets.PAT }} | |
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 | |
- name: Docker Image Build | |
run: | | |
echo "${{ secrets.DOCKERPW }}" | docker login -u "krisharyan36" --password-stdin | |
docker image build -t sdp:latest . | |
docker tag sdp:latest 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 replace --force -f /root/mlops/deployment.yaml |