chore: add model_v16.pkl #47
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: CI Pipeline | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- retrain | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Needed to push back updated VERSION file | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./app/api/requirements.txt | |
pip install flake8 pytest | |
- name: Run linter (flake8) | |
run: flake8 ./app --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Increment version | |
id: version | |
run: | | |
if [ ! -f VERSION ]; then | |
echo "1.0" > VERSION | |
fi | |
VERSION=$(cat VERSION) | |
MAJOR=$(echo $VERSION | cut -d. -f1) | |
MINOR=$(echo $VERSION | cut -d. -f2) | |
MINOR=$((MINOR + 1)) | |
NEW_VERSION="${MAJOR}.${MINOR}" | |
echo $NEW_VERSION > VERSION | |
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
- name: Commit updated version | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git add VERSION | |
git commit -m "chore: bump version to ${{ env.VERSION }}" | |
git push | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./app/api | |
file: ./docker/Dockerfile | |
push: true | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/mlops-flask-api:latest | |
${{ secrets.DOCKER_USERNAME }}/mlops-flask-api:${{ env.VERSION }} |