Skip to main content
Setting Up GitHub Actions for CI/CD

Setting Up GitHub Actions for CI/CD

Andrius LukminasAndrius LukminasDecember 26, 20255 min read559 views

Pipeline Overview

Every push triggers our CI/CD pipeline:

  1. Lint & Type Check - Catch errors early
  2. Run Tests - Unit and integration tests
  3. Build Docker Image - Multi-stage production build
  4. Push to Registry - Tag with commit SHA
  5. Deploy - SSH to server, pull and restart

Workflow Configuration

name: Deploy Application

on:
  push:
    branches: [main]

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

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Lint and type check
        run: |
          npm run lint
          npm run type-check

      - name: Build Docker image
        run: docker build -t app:${{ github.sha }} .

Secrets Management

Sensitive values (SSH keys, API tokens) are stored in GitHub Secrets and injected at runtime. Never commit secrets to the repository.

Deployment Notifications

We send webhook notifications to our platform at each deployment step, visible in the admin dashboard.

Related Articles

Comments

0/5000 characters

Comments from guests require moderation.