diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 460a463..6728cd4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,6 +23,43 @@ jobs: with: push: true tags: smallbuster/fire-exam:latest + - name: Notify Telegram start building + if: always() + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + 🚀 Стадия сборки запущена! + Сервер: ${{ secrets.SERVER_NAME }} + Репозиторий: ${{ github.repository }} + - name: Notify Telegram about success + if: success() + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + ✅ Сборка успешно завершена! + Сервер: ${{ secrets.SERVER_NAME }} + Репозиторий: ${{ github.repository }} + Ветка: ${{ github.ref_name }} + Коммит: ${{ github.sha }} + + - name: Notify Telegram about failure + if: failure() + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + ❌ Сборка проекта неудачна! + Сервер: ${{ secrets.SERVER_NAME }} + Репозиторий: ${{ github.repository }} + Ветка: ${{ github.ref_name }} + Коммит: ${{ github.sha }} + Подробности: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + deploy: runs-on: self-hosted needs: build @@ -52,6 +89,17 @@ jobs: run: | docker compose -f docker-compose.yaml up -d + - name: Notify Telegram start building + if: always() + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + 🐳 Стадия деплоя запущена! + Сервер: ${{ secrets.SERVER_NAME }} + Репозиторий: ${{ github.repository }} + - name: Notify Telegram about success if: success() uses: appleboy/telegram-action@master @@ -60,11 +108,10 @@ jobs: token: ${{ secrets.TELEGRAM_BOT_TOKEN }} message: | ✅ Деплой успешно завершен! + Сервер: ${{ secrets.SERVER_NAME }} Репозиторий: ${{ github.repository }} - Ветка: ${{ github.ref }} + Ветка: ${{ github.ref_name }} Коммит: ${{ github.sha }} - Сервер: ${{ secrets.SERVER_IP }} - Путь: ${{ secrets.DEPLOY_PATH }} - name: Notify Telegram about failure if: failure() @@ -74,7 +121,8 @@ jobs: token: ${{ secrets.TELEGRAM_BOT_TOKEN }} message: | ❌ Деплой не удался! + Сервер: ${{ secrets.SERVER_NAME }} Репозиторий: ${{ github.repository }} - Ветка: ${{ github.ref }} + Ветка: ${{ github.ref_name }} Коммит: ${{ github.sha }} - Подробности: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \ No newline at end of file + Подробности: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}