NextNodeTemplate/.github/workflows/ci.yml
2025-11-02 16:47:30 +03:00

49 lines
1.0 KiB
YAML

# GitHub Actions CI/CD workflow
name: CI/CD
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci
- name: Run ESLint
working-directory: ./frontend
run: npm run lint
- name: Check Prettier formatting
working-directory: ./frontend
run: npm run format:check
- name: Build frontend
working-directory: ./frontend
run: npm run build
- name: Install backend dependencies
working-directory: ./backend
run: npm ci
- name: Check backend syntax
working-directory: ./backend
run: node --check server.js