How I Set Up CI/CD with GitHub Actions in a Real Node.js Project

In this post, I’ll show how we used GitHub Actions to automate CI/CD for a real open-source fullstack application — BinaryStudioAcademy/bsa-2022-streamlet.

🧱 About the Project

The project is a collaborative platform for video content, bu…


This content originally appeared on DEV Community and was authored by Viktor Sivulskiy

In this post, I’ll show how we used GitHub Actions to automate CI/CD for a real open-source fullstack application — BinaryStudioAcademy/bsa-2022-streamlet.

🧱 About the Project

The project is a collaborative platform for video content, built as part of an educational initiative. It includes:

  • Node.js backend (NestJS)
  • PostgreSQL, Prisma
  • Frontend on React
  • Docker-based development
  • Tests and linting

This made it a perfect playground to implement CI workflows.

⚙️ Why CI/CD with GitHub Actions

We wanted to:

  • Run tests on every pull request
  • Validate that code builds
  • Lint for consistency
  • Eventually — deploy to environments

And we didn’t want to add extra tools or services — just GitHub.

🚀 Creating the GitHub Actions Workflow

All CI/CD workflows live in .github/workflows/. Here’s a minimal setup for Node.js:

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js
      uses: actions/setup-node@v3
      with:
        node-version: 18

    - run: npm install
    - run: npm run lint
    - run: npm run test

✅ Tip: You can create multiple workflows for frontend/backend separately if needed.

🧪 Test Output in GitHub UI

After pushing a PR, GitHub shows CI status directly in the PR tab. Green means ✅ everything is passing.

You can also explore logs in the Actions tab. This helps reviewers catch problems early — before merging anything into main.

📦 Expanding to Deployments

In advanced scenarios, we also:

  • Built Docker images
  • Deployed to staging (with secrets)
  • Used concurrency to cancel stale builds

But even with just the basics, we improved code quality and confidence.

⚠️ Gotchas & Lessons Learned

  • Always cache node_modules to speed up runs (with actions/cache)
  • Keep workflows fast — slow pipelines discourage devs
  • If you split into microservices — build and test them in parallel
  • Protect main branch using CI rules in GitHub settings

✅ Conclusion

GitHub Actions is a powerful and free way to bring CI/CD into any project — even student or hobby apps. Our team benefited a lot from having automated checks, and it made collaboration smooth and scalable.

If you're just starting, don’t overcomplicate. Start with one workflow file. Add jobs as your project grows.

Got questions or want to share your setup? Drop a comment!


This content originally appeared on DEV Community and was authored by Viktor Sivulskiy


Print Share Comment Cite Upload Translate Updates
APA

Viktor Sivulskiy | Sciencx (2025-04-01T02:33:47+00:00) How I Set Up CI/CD with GitHub Actions in a Real Node.js Project. Retrieved from https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/

MLA
" » How I Set Up CI/CD with GitHub Actions in a Real Node.js Project." Viktor Sivulskiy | Sciencx - Tuesday April 1, 2025, https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/
HARVARD
Viktor Sivulskiy | Sciencx Tuesday April 1, 2025 » How I Set Up CI/CD with GitHub Actions in a Real Node.js Project., viewed ,<https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/>
VANCOUVER
Viktor Sivulskiy | Sciencx - » How I Set Up CI/CD with GitHub Actions in a Real Node.js Project. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/
CHICAGO
" » How I Set Up CI/CD with GitHub Actions in a Real Node.js Project." Viktor Sivulskiy | Sciencx - Accessed . https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/
IEEE
" » How I Set Up CI/CD with GitHub Actions in a Real Node.js Project." Viktor Sivulskiy | Sciencx [Online]. Available: https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/. [Accessed: ]
rf:citation
» How I Set Up CI/CD with GitHub Actions in a Real Node.js Project | Viktor Sivulskiy | Sciencx | https://www.scien.cx/2025/04/01/how-i-set-up-ci-cd-with-github-actions-in-a-real-node-js-project/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.