Menu

Your First CI Pipeline With GitHub Actions: From Push to Green Check
πŸ“°

Your First CI Pipeline With GitHub Actions: From Push to Green Check

DEV Community: cicdΒ·FlatlinerAtheist | CLI-NERDSΒ·4 days ago
#kSJxOOP6
#devtocicd#devto#dev#build#node
Reading 0:00
15s threshold

Continuous integration sounds like enterprise ceremony until the day it saves you from yourself. Mine was a Friday evening push that broke the production build β€” caught not by me, but by a little red X next to the commit, before I merged anything. That red X is the whole point: a robot that checks your work on every push, so "works on my machine" stops being a thing you say out loud.

GitHub Actions is the easiest way to get that robot, and you do not need to understand YAML deeply to use it. You need one file. Let us build it together and then pull apart what each line does.

The one-file setup

In your repository, create .github/workflows/ci.yml :

name : CI

on : push : branches : [ main ] pull_request :

jobs : test : runs-on : ubuntu-latest steps : - uses : actions/checkout@v4

- uses : actions/setup-node@v4 with : node-version : 22 cache : npm

- run : npm ci - run : npm run lint - run : npm test - run : npm run build

Enter fullscreen mode

Exit fullscreen mode

Push that file, open the Actions tab in…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.