Skip to content

Commit

Permalink
Add GitHub Actions secrets configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
terapevt1981 committed Nov 11, 2024
1 parent b4efbef commit 669289b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/gcp-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ on:
- main

env:
env:
# Transport Service
TRANSPORT_SERVICE_DATABASE_URL: ${{ secrets.TRANSPORT_SERVICE_DATABASE_URL }}
TRANSPORT_SERVICE_PORT: 8080
TRANSPORT_SERVICE_LOG_LEVEL: INFO

# Translation Service
TRANSLATION_SERVICE_DATABASE_URL: ${{ secrets.TRANSLATION_SERVICE_DATABASE_URL }}
TRANSLATION_SERVICE_PORT: 8080
TRANSLATION_SERVICE_LOG_LEVEL: INFO
TRANSLATION_SERVICE_SUPPORTED_LANGUAGES: '{"en":"English","ru":"Русский","uk":"Українська","de":"Deutsch","fr":"Français","es":"Español","it":"Italiano"}'

# Telegram Bot Service
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TRANSPORT_SERVICE_URL: ${{ secrets.TRANSPORT_SERVICE_URL }}
TELEGRAM_BOT_DATABASE_URL: ${{ secrets.TELEGRAM_BOT_DATABASE_URL }}
TELEGRAM_BOT_SUPPORTED_LANGUAGES: '{"en":"English","ru":"Русский","uk":"Українська","de":"Deutsch","fr":"Français","es":"Español","it":"Italiano"}'
TELEGRAM_BOT_LOG_LEVEL: INFO

GCP_REGION: ${{ secrets.GCP_REGION }}
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER_NAME }}
Expand Down
22 changes: 22 additions & 0 deletions translation_service/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
from dotenv import load_dotenv

load_dotenv()

# Базовые настройки сервиса перевода
DATABASE_URL = os.getenv('TRANSLATION_SERVICE_DATABASE_URL')
SERVICE_PORT = int(os.getenv('TRANSLATION_SERVICE_PORT', 8080))

# Поддерживаемые языки
SUPPORTED_LANGUAGES = {
'en': 'English',
'ru': 'Русский',
'uk': 'Українська',
'de': 'Deutsch',
'fr': 'Français',
'es': 'Español',
'it': 'Italiano'
}

# Настройки логирования
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
13 changes: 13 additions & 0 deletions transport_service/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
from dotenv import load_dotenv

load_dotenv()

# Базовые настройки сервиса транспорта
DATABASE_URL = os.getenv('TRANSPORT_SERVICE_DATABASE_URL')
SERVICE_PORT = int(os.getenv('TRANSPORT_SERVICE_PORT', 8080))

# Настройки логирования
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')

# Другие параметры конфигурации при необходимости
2 changes: 1 addition & 1 deletion transport_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def route_request(request: ServiceRequest):
request_counter.inc()

service_endpoints = {
"translation": "http://translation-service:8000",
"translation": "http://translation-service:8080",
"telegram": "http://telegram-bot-service:8080"
}

Expand Down
3 changes: 2 additions & 1 deletion transport_service/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ httpx==0.19.0
prometheus-client==0.11.0
pydantic==1.8.2
pytest
pytest-cov
pytest-cov
python-dotenv

0 comments on commit 669289b

Please sign in to comment.