From 7e88c669281da0a3af73094549c045ae6e15bc81 Mon Sep 17 00:00:00 2001 From: LeonG11 Date: Thu, 7 May 2026 15:52:24 +0300 Subject: [PATCH] 1212 --- .gitea/workflows/ci.yaml | 49 ++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 95a066e..cfe22b6 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -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