0Pricing
MLOps Academy · Lección

Un workflow de GitHub Actions para ML

Ejecute lint, pruebas y entrenamiento con cada push.

Un workflow de GitHub Actions para ML es una lección gratuita de MLOps Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de MLOps Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de MLOps Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Meet GitHub Actions

GitHub Actions runs your scripts on GitHub's servers whenever something happens in your repo, like a push, so you never run CI by hand again. ⚙️

Workflows Live in YAML

A workflow is a YAML file inside .github/workflows. GitHub reads it and follows your instructions step by step on each trigger.

.github/workflows/ml.yml

The on: Trigger

The on key says when to run. Here it fires on every push, so each commit kicks off your ML checks automatically.

on:
  push:
    branches: [main]

Jobs Run the Work

A workflow holds one or more jobs. Each job runs on a fresh virtual machine, so your pipeline always starts from a clean, predictable state.

jobs:
  build:
    runs-on: ubuntu-latest

Steps Are the Recipe

Inside a job, steps run in order from top to bottom. Each step is either a reusable action or a plain shell command you write.

Check Out Your Code

The first step almost always uses the checkout action to copy your repo onto the runner. Without it, the machine has no code to test.

- uses: actions/checkout@v4

Set Up Python

For an ML repo you set up Python next, choosing the exact version so the runner matches the environment your team trains in.

- uses: actions/setup-python@v5
  with:
    python-version: "3.11"

Install Dependencies

Then you install your pinned packages so the runner has the same libraries you use locally. This makes every CI run reproducible.

- run: pip install -r requirements.txt

Lint, Then Test

Now add the ML checks: a lint step to catch style issues, then pytest to run your data and model tests on the fresh runner.

- run: ruff check .
- run: pytest

Train on a Sample

A final step can train on a small sample to prove the pipeline works end to end, keeping CI fast while still exercising real code.

- run: python train.py --sample 1000

Watch It Run

Push your YAML and open the Actions tab. GitHub shows a live log of each step, with a green check when your ML pipeline passes. ✅

Quick Check

Where must a GitHub Actions workflow file live to be picked up?

Recap

A workflow YAML in .github/workflows defines triggers, jobs, and ordered steps. For ML you check out code, set up Python, install deps, then lint, test, and train.

Preguntas frecuentes

¿La lección «Un workflow de GitHub Actions para ML» es gratis?

Sí — el texto completo de «Un workflow de GitHub Actions para ML» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de MLOps Academy, actualiza a CoddyKit PRO. El curso de MLOps Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Un workflow de GitHub Actions para ML»?

Ejecute lint, pruebas y entrenamiento con cada push. Practicas MLOps Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar MLOps Academy?

No se requiere experiencia previa. MLOps Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.

¿Cuánto tiempo toma la lección «Un workflow de GitHub Actions para ML»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de MLOps Academy?

Sí. Cada lección de MLOps Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Qué significa CI/CD para los modelos
  2. Un workflow de GitHub Actions para ML
  3. Condicione las fusiones a la calidad del modelo
  4. Compile y envíe la imagen al publicar una versión
← Volver a MLOps Academy