Files
GmRelayBot/.gitea/workflows/deploy.yml
T
Toutsu de9f56c97d
PR Checks / test-and-build (pull_request) Failing after 3m18s
feat(#21): support selected telegram topics for schedules
Route new schedules to an existing forum topic when /newsession is sent inside one, create bot-owned topics only from the forum root, and keep group notifications/dashboard updates threaded to the stored topic.

Persist topic ownership so deletion only removes empty bot-created topics, add topic routing tests and smoke coverage, and bump release metadata to 1.14.0.
2026-05-12 12:07:51 +03:00

79 lines
2.9 KiB
YAML

name: Deploy Telegram Bot
on:
push:
branches:
- main
env:
VERSION: 1.14.0
jobs:
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
build-and-push:
runs-on: ubuntu-latest # Замени на метку твоего раннера, если она другая
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.codeanddice.ru # НАПРИМЕР: gitea.my-server.com
username: toutsu
password: ${{ secrets.GIT_TOKEN }}
- name: Build Bot image
run: |
docker build \
--label "org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}" \
-f src/GmRelay.Bot/Dockerfile \
-t git.codeanddice.ru/toutsu/gmrelay-bot:latest \
-t git.codeanddice.ru/toutsu/gmrelay-bot:${{ env.VERSION }} \
.
- name: Push Bot image
run: |
docker push git.codeanddice.ru/toutsu/gmrelay-bot:latest
docker push git.codeanddice.ru/toutsu/gmrelay-bot:${{ env.VERSION }}
- name: Build Web image
run: |
docker build \
--label "org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}" \
-f src/GmRelay.Web/Dockerfile \
-t git.codeanddice.ru/toutsu/gmrelay-web:latest \
-t git.codeanddice.ru/toutsu/gmrelay-web:${{ env.VERSION }} \
.
- name: Push Web image
run: |
docker push git.codeanddice.ru/toutsu/gmrelay-web:latest
docker push git.codeanddice.ru/toutsu/gmrelay-web:${{ env.VERSION }}
# ЧАСТЬ 2: Запускаем эти образы на самом сервере
deploy:
needs: build-and-push
runs-on: ubuntu-latest # Тот же локальный раннер
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .env file with secrets
run: |
echo "TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}" > .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "TELEGRAM_BOT_USERNAME=${{ secrets.TELEGRAM_BOT_USERNAME }}" >> .env
echo "TELEGRAM_MINI_APP_URL=${{ secrets.TELEGRAM_MINI_APP_URL }}" >> .env
- name: Deploy Containers
run: |
# Авторизуемся локальным докером в нашей Gitea
docker login git.codeanddice.ru/ -u toutsu -p ${{ secrets.GIT_TOKEN }}
# Pull гарантирует, что мы получили нужную версию.
docker compose pull bot web
# Запускаем! Флаг -d оставит их работать в фоне.
docker compose up -d