Skip to content

feat: Add initial implementation for payment, gallery, user, authenti… #12

feat: Add initial implementation for payment, gallery, user, authenti…

feat: Add initial implementation for payment, gallery, user, authenti… #12

name: Build NestJS API
on:
push:
branches:
- main
paths:
- "backend/**"
jobs:
build-backend:
runs-on: ubuntu-latest
timeout-minutes: 10 # Защита от бесконечного зависания
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
# 1. Настраиваем Node.js и кеширование для npm
- name: Setup Node.js
uses: actions/setup-node@v4.1.0
with:
node-version: "20"
cache: "npm" # Теперь используем только кеш npm
# 2. Устанавливаем зависимости
# Используем npm ci для максимальной стабильности в CI/CD
# Флаг --legacy-peer-deps нужен для корректной работы Nx и зависимостей Angular/NestJS
- name: Install dependencies
run: npm ci --legacy-peer-deps
# 3. Сборка через Nx
- name: Build NestJS
run: npx nx build api --prod
# 4. Деплой билда в ветку gh-backend
- name: Deploy Build to gh-backend branch
uses: JamesIves/github-pages-deploy-action@v4.7.2
with:
folder: dist/apps/api
branch: gh-backend
token: ${{ secrets.GITHUB_TOKEN }}
clean: true