DEV3 Technologies home

DEV3 Developer Forum

How do I set up basic CI/CD for a small project?

General IT0 views
dev3 ·

We deploy by SSH-ing into a server and pulling the latest code. It has gone wrong a few times. What is a simple, sensible CI/CD setup for a small team?

#ci-cd#devops#automation

0

1 reply

dev3 ·

Short answer: run tests automatically on every pull request, and deploy from the main branch through a scripted, repeatable process with an easy rollback. Start with the smallest version of that.

CI: continuous integration

On every push and pull request, a CI service should:

  1. Install dependencies from the lock file.
  2. Run linting and formatting checks.
  3. Run the tests.
  4. Build the project to confirm it compiles.

Make these checks required before merging into main.

A minimal pipeline, written for GitHub Actions, looks like this:

name: ci
on: [pull_request, push]
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 test

CD: continuous delivery or deployment

After checks pass on main:

  • Build an artifact (a bundle or a container image).
  • Deploy it through a script or the platform's integration, instead of manual steps.
  • Run database migrations as part of the release, ideally in a backward-compatible way.
  • Run a quick smoke test or health check after deploying.

Make deploys safe

  • Rollback plan: keep the previous release available and be able to switch back quickly.
  • Staging environment that mirrors production for important changes.
  • Secrets in the CI secret store, not in the repository.
  • Small, frequent releases are less risky than rare big ones.
  • Notifications of deploy success or failure to your team chat.

Pitfalls

  • Slow pipelines that people bypass; cache dependencies and run tests in parallel.
  • Flaky tests that make CI untrusted.
  • Migrations that cannot be rolled back with the code.

Automate the manual steps you already do, one at a time, starting with the test run.

0

Your reply

Every post is reviewed by DEV3 before it appears. Usually reviewed within 24 hours.

Markdown supported. Use ``` for code blocks. Images are not allowed.