Member-only story
GitHub Actions in MLOps: Automatically Check and Deploy Your ML Model
Automate Your ML Pipeline with GitHub Actions
Motivation
Imagine your company is creating an ML-powered service. As a data scientist, you might try to continuously improve the existing ML model.
Once you find a better model, how do you make sure the service doesn’t break when you deploy the new model?
Wouldn’t it be nice if you can create a workflow that:
- Automatically tests a pull request from a team member
- Merges a pull request when all tests passed
- Deploys the ML model to the existing service?

In this article, you will learn how to create such a workflow with GitHub Actions.
What are GitHub Actions?
GitHub Actions allows you to automate your workflows, making it faster to build, test, and deploy your code.
In general, a workflow will look similar to the below:
There are 3 important concepts to understand from the code above:
- When an event occurs (such as a push or a pull request), a workflow consisting of one or more jobs will be triggered
- Jobs are independent of each other. Each job is a set of steps that runs inside its own virtual machine runner or inside a container.
- Steps are dependent on each other and are executed in order.

Let’s dig deeper into these concepts in the next few sections.
Find the Best Parameters
The first steps in an ML project include experimenting with different parameters and models in a non-master branch. In the previous article, I mentioned how to use…