deploy-fix
Some checks failed
Deploy on push / deploy (push) Failing after 3m36s

This commit is contained in:
2025-08-28 20:48:15 +03:00
parent d677d6547c
commit b0d60bb836
2 changed files with 40 additions and 0 deletions

View File

@@ -88,6 +88,26 @@ jobs:
uv run pytest tests/ -v || echo "⚠️ Тесты завершились с ошибками, но продолжаем деплой"
continue-on-error: true
- name: Restore Git Repository
if: always()
run: |
echo "🔧 Восстанавливаем git репозиторий для деплоя..."
# Проверяем состояние git
git status || echo "⚠️ Git репозиторий поврежден, восстанавливаем..."
# Если git поврежден, переинициализируем
if [ ! -d ".git" ] || [ ! -f ".git/HEAD" ]; then
echo "🔄 Переинициализируем git репозиторий..."
git init
git remote add origin https://github.com/${{ github.repository }}.git
git fetch origin
git checkout ${{ github.ref_name }}
fi
# Проверяем финальное состояние
git status
echo "✅ Git репозиторий готов для деплоя"
- name: Get Repo Name
id: repo_name
run: echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY##*/})"
@@ -96,6 +116,14 @@ jobs:
id: branch_name
run: echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})"
- name: Verify Git Before Deploy Main
if: github.ref == 'refs/heads/main'
run: |
echo "🔍 Проверяем git перед деплоем на main..."
git status
git log --oneline -5
echo "✅ Git репозиторий готов"
- name: Push to dokku for main branch
if: github.ref == 'refs/heads/main'
uses: dokku/github-action@master
@@ -104,6 +132,14 @@ jobs:
git_remote_url: 'ssh://dokku@v2.discours.io:22/discoursio-api'
ssh_private_key: ${{ secrets.V2_PRIVATE_KEY }}
- name: Verify Git Before Deploy
if: github.ref == 'refs/heads/dev'
run: |
echo "🔍 Проверяем git перед деплоем на dev..."
git status
git log --oneline -5
echo "✅ Git репозиторий готов"
- name: Push to dokku for dev branch
if: github.ref == 'refs/heads/dev'
uses: dokku/github-action@master

View File

@@ -20,6 +20,10 @@
- Добавлен `continue-on-error: true` для шага тестов
- Добавлен информативный шаг с результатами выполнения
- Деплой продолжается даже при неуспешных тестах
- **Исправлен деплой**: Решена проблема с повреждением git репозитория в CI
- Добавлен шаг `Restore Git Repository` для восстановления git после тестов
- Добавлены проверки состояния git перед деплоем на main и dev ветки
- Автоматическое восстановление git репозитория при повреждении
## [0.9.13] - 2025-08-27