Compare commits

..

7 Commits

Author SHA1 Message Date
5a22e07b45 Merge pull request 'test' (#9) from test into main
Reviewed-on: #9
2026-04-02 16:49:16 +03:00
8a36f5744d Merge pull request 'edit prekol ac dc' (#8) from fix into test
All checks were successful
CI/CD / test-backend (pull_request) Successful in 7s
CI/CD / test-frontend (pull_request) Successful in 11s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
Reviewed-on: #8
2026-04-02 16:48:35 +03:00
65056c473d Merge pull request 'test' (#7) from test into main
Reviewed-on: http://5.129.221.254:3000/RLK/python-common-app/pulls/7
2026-03-24 14:05:59 +03:00
8378ec1b3e Merge pull request 'Refactor CI workflow to localize job names in Russian and remove deprecated multistep and test workflows. Update artifact upload step to ensure clarity in job descriptions.' (#6) from fix into test
All checks were successful
CI/CD / test-backend (pull_request) Successful in 6s
CI/CD / test-frontend (pull_request) Successful in 9s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
Reviewed-on: http://5.129.221.254:3000/RLK/python-common-app/pulls/6
2026-03-24 14:05:16 +03:00
db458df1d6 Merge pull request 'test' (#5) from test into main
Reviewed-on: http://5.129.221.254:3000/RLK/python-common-app/pulls/5
2026-03-24 12:38:04 +03:00
9d4fc2cff5 Merge pull request 'Add initial setup for React and Vite application' (#4) from fix into test
All checks were successful
CI/CD / test-backend (pull_request) Successful in 6s
CI/CD / test-frontend (pull_request) Successful in 9s
CI/CD / create-archives (pull_request) Successful in 3s
CI/CD Pipeline / Overall Status ✅ All checks passed successfully
CI/CD / pr-status (pull_request) Successful in 1s
CI/CD / comment-on-failure (pull_request) Has been skipped
CI/CD / cleanup (pull_request) Successful in 1s
Reviewed-on: http://5.129.221.254:3000/RLK/python-common-app/pulls/4
2026-03-24 12:37:11 +03:00
6655811cc1 Merge pull request 'fix' (#3) from fix into test
Reviewed-on: http://5.129.221.254:3000/RLK/python-common-app/pulls/3
2026-03-24 11:59:51 +03:00
2 changed files with 0 additions and 98 deletions

View File

@@ -20,12 +20,6 @@ jobs:
with: with:
python-version: '3.11' python-version: '3.11'
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('api/requirements.txt') }}
- name: Установка зависимостей - name: Установка зависимостей
run: | run: |
cd api cd api
@@ -60,82 +54,6 @@ jobs:
cd web cd web
npm run build npm run build
build-and-deploy:
needs: test-backend
runs-on: ubuntu-latest
if: success() # Запускается только если тесты прошли успешно
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: git.rlkdev.ru # Замените на ваш Gitea registry
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('api/requirements.txt') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: git.rlkdev.ru/rlk/fastapi-app:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Stop and remove old container
run: |
docker stop fastapi-test-container || true
docker rm fastapi-test-container || true
- name: Run new container
run: |
docker run -d \
--name fastapi-test-container \
-p 8080:8000 \
--restart unless-stopped \
git.rlkdev.ru/rlk/fastapi-app:latest
- name: Wait for container to be ready
run: |
timeout=60
interval=2
elapsed=0
while [ $elapsed -lt $timeout ]; do
if docker logs fastapi-test-container 2>&1 | grep -q "Application startup complete"; then
echo "Application startup detected in logs"
echo "Deployment successful!"
exit 0
fi
echo "Waiting for startup log... ($elapsed/$timeout sec)"
sleep $interval
elapsed=$((elapsed + interval))
done
echo "Timeout: Application startup not detected in logs"
docker logs fastapi-container
exit 1
- name: Clean up dangling images
run: |
echo "Removing old dangling images..."
docker image prune -f
echo "Current images after cleanup:"
docker images
# Явный статус для PR # Явный статус для PR
pr-status: pr-status:
needs: [test-backend, test-frontend] needs: [test-backend, test-frontend]

View File

@@ -1,16 +0,0 @@
FROM python:3.11-slim
WORKDIR /app
# 1. Копируем только файл с зависимостями (меняется редко)
COPY api/requirements.txt requirements.txt
# 2. Устанавливаем зависимости (слой кэшируется, пока не изменился requirements.txt)
RUN pip install --no-cache-dir -r requirements.txt
# 3. Копируем весь остальной код (меняется часто)
COPY api/ api/
EXPOSE 8000
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--root-path", "/python-common-app"]