Merge pull request #19 from redrockjs/dev

fix: ci/cd telegram notification
This commit was merged in pull request #19.
This commit is contained in:
Valeriy G.
2025-06-19 21:45:32 +03:00
committed by GitHub

View File

@@ -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 }}