Compare commits

...

2 Commits

Author SHA1 Message Date
Jakub Zaręba
5d5717b77b s 2023-05-24 01:32:24 +02:00
Jakub Zaręba
dddc7d44e0 s 2023-05-24 01:25:42 +02:00
2 changed files with 72 additions and 1 deletions

71
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: GitHub Workflow
on:
workflow_dispatch:
inputs:
epochs:
description: 'Number of epochs'
required: true
default: '10'
jobs:
build-and-train:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/training-model:latest
- name: Run training
run: docker run ${{ secrets.DOCKERHUB_USERNAME }}/training-model:latest python3 ../../train.py --epochs ${{ github.event.inputs.epochs }}
evaluate:
needs: build-and-train
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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 pandas numpy tensorflow scikit-learn matplotlib
- name: Run evaluation
run: python ../../evaluate.py
archive:
needs: evaluate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Archive model
run: tar -czvf ../../model.tar.gz ../../model.h5
- name: Upload model
uses: actions/upload-artifact@v2
with:
name: model
path: ../../model.tar.gz

View File

@ -62,7 +62,7 @@ pipeline {
stage('Run DVC Pipeline') { stage('Run DVC Pipeline') {
steps { steps {
sh 'PATH=$PATH:~/.local/bin/ dvc repro' sh 'PATH=$PATH:~/.local/bin/ dvc reproduce'
} }
} }