Merge branch 'yolo-achievement' #6
This file contains hidden or 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: Predictive Maintenance Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| register-dataset: | |
| runs-on: ubuntu-latest | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - name: Upload raw engine dataset to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| run: | | |
| cd src && python data_register.py | |
| data-prep: | |
| needs: register-dataset | |
| runs-on: ubuntu-latest | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - name: Run data preparation (cleaning, splitting, upload) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| run: | | |
| cd src && python data_prep.py | |
| model-training: | |
| needs: data-prep | |
| runs-on: ubuntu-latest | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| HF_MODEL_REPO: ${{ secrets.HF_MODEL_REPO }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - name: Train model with MLflow tracking and register to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_DATASET_REPO: ${{ secrets.HF_DATASET_REPO }} | |
| HF_MODEL_REPO: ${{ secrets.HF_MODEL_REPO }} | |
| run: | | |
| cd src && python train.py | |
| deploy-hosting: | |
| needs: model-training | |
| runs-on: ubuntu-latest | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_SPACE_REPO: ${{ secrets.HF_SPACE_REPO }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - name: Deploy Streamlit app and Dockerfile to Hugging Face Space | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_SPACE_REPO: ${{ secrets.HF_SPACE_REPO }} | |
| run: | | |
| cd src && python deploy_to_hf.py | |