add Automate model retraining with Amazon SageMaker Pipelines when dr… #46
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: model-training | |
on: | |
push: | |
# paths: | |
# - 'model-cicd-pipeline/**' | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./model-cicd-pipeline/model-train-cml-report | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- uses: iterative/setup-cml@v1 | |
- name: Install packages | |
run: | | |
pip install -r requirements.txt | |
- name: Train model | |
run: | | |
python train.py | |
- name: Write CML report | |
env: | |
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "# MODEL METRICS" > report.md | |
cat metrics.txt >> report.md | |
echo "## Data viz" >> report.md | |
echo "![feature_importance](./model-cicd-pipeline/model-train-cml-report/feature_importance.png)" >> report.md | |
echo "![residuals](./model-cicd-pipeline/model-train-cml-report/residuals.png)" >> report.md | |
cml comment create report.md | |