test build and deploy #10

Open
RaiLinKey wants to merge 12 commits from fix into test
Showing only changes of commit 4e8300f6f0 - Show all commits

View File

@@ -20,14 +20,6 @@ jobs:
with: with:
python-version: '3.11' python-version: '3.11'
- name: Кэширование pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('api/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Установка зависимостей - name: Установка зависимостей
run: | run: |
cd api cd api
@@ -114,22 +106,22 @@ jobs:
- name: Wait for container to be ready - name: Wait for container to be ready
run: | run: |
for i in {1..30}; do timeout=60
if curl -s http://localhost:8080/health > /dev/null; then interval=2
echo "Container is ready!" elapsed=0
while [ $elapsed -lt $timeout ]; do
if docker logs fastapi-container 2>&1 | grep -q "Application startup complete"; then
echo "Application startup detected in logs"
exit 0 exit 0
fi fi
echo "Waiting for container... ($i/30)" echo "Waiting for startup log... ($elapsed/$timeout sec)"
sleep 2 sleep $interval
elapsed=$((elapsed + interval))
done done
echo "Container failed to start properly" echo "Timeout: Application startup not detected in logs"
docker logs fastapi-container docker logs fastapi-container
exit 1
- name: Verify deployment
run: |
curl -f http://localhost:8080/ || exit 1
echo "Deployment successful!" echo "Deployment successful!"
exit 1
# Явный статус для PR # Явный статус для PR
pr-status: pr-status: