1212
MRP Full Stack CI/CD / build-and-deploy (push) Has been cancelled
MRP Full Stack CI/CD / test-backend (push) Has been cancelled
MRP Full Stack CI/CD / test-frontend (push) Has been cancelled

This commit is contained in:
2026-05-07 15:52:24 +03:00
parent 6927bddfd5
commit 7e88c66928
+39 -10
View File
@@ -1,22 +1,51 @@
name: MRP Full Stack CI/CD
on: [push]
on:
push:
branches: [main, master]
jobs:
validate-and-deploy:
test-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Test Backend
- name: Setup Go
uses: actions/setup-go@v5 # Используем v5 (стабильнее)
with:
go-version: "1.24"
- name: Run Go tests
run: |
# В этом образе Go обычно лежит здесь, добавляем в PATH вручную
export PATH=$PATH:/usr/local/go/bin
cd backend
go version # Для проверки в логах
go test ./... -v
- name: Deploy Full Stack
test-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install & Build
run: |
# Docker уже знает о вашем проекте, так как мы пробросили sock
docker compose up -d --build
cd frontend
npm install --legacy-peer-deps
npm run build
build-and-deploy:
runs-on: ubuntu-latest
needs: [test-backend, test-frontend]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy full stack
run: |
# Мы не используем Buildx, так как работаем напрямую с Docker хоста
docker compose up -d --build --remove-orphans