test build and deploy #10

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

View File

@@ -20,14 +20,6 @@ jobs:
with:
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: Установка зависимостей
run: |
cd api
@@ -114,22 +106,22 @@ jobs:
- name: Wait for container to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:8080/health > /dev/null; then
echo "Container is ready!"
timeout=60
interval=2
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
fi
echo "Waiting for container... ($i/30)"
sleep 2
echo "Waiting for startup log... ($elapsed/$timeout sec)"
sleep $interval
elapsed=$((elapsed + interval))
done
echo "Container failed to start properly"
echo "Timeout: Application startup not detected in logs"
docker logs fastapi-container
exit 1
- name: Verify deployment
run: |
curl -f http://localhost:8080/ || exit 1
echo "Deployment successful!"
exit 1
# Явный статус для PR
pr-status: