feat: implement centralized versioning v1.0.0
Deploy Telegram Bot / build-and-push (push) Successful in 25s
Deploy Telegram Bot / deploy (push) Successful in 9s

This commit is contained in:
2026-04-17 16:17:51 +03:00
parent 862cc38309
commit 5de3891966
3 changed files with 13 additions and 7 deletions
+10 -5
View File
@@ -5,6 +5,9 @@ on:
branches: branches:
- main - main
env:
VERSION: 1.0.0
jobs: jobs:
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами) # ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
build-and-push: build-and-push:
@@ -26,7 +29,9 @@ jobs:
context: . context: .
file: src/GmRelay.Bot/Dockerfile file: src/GmRelay.Bot/Dockerfile
push: true push: true
tags: git.codeanddice.ru/toutsu/gmrelay-bot:latest tags: |
git.codeanddice.ru/toutsu/gmrelay-bot:latest
git.codeanddice.ru/toutsu/gmrelay-bot:${{ env.VERSION }}
labels: | labels: |
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }} org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
@@ -36,7 +41,9 @@ jobs:
context: . context: .
file: src/GmRelay.Web/Dockerfile file: src/GmRelay.Web/Dockerfile
push: true push: true
tags: git.codeanddice.ru/toutsu/gmrelay-web:latest tags: |
git.codeanddice.ru/toutsu/gmrelay-web:latest
git.codeanddice.ru/toutsu/gmrelay-web:${{ env.VERSION }}
labels: | labels: |
org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }} org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }}
@@ -59,10 +66,8 @@ jobs:
# Авторизуемся локальным докером в нашей Gitea # Авторизуемся локальным докером в нашей Gitea
docker login git.codeanddice.ru/ -u toutsu -p ${{ secrets.GIT_TOKEN }} docker login git.codeanddice.ru/ -u toutsu -p ${{ secrets.GIT_TOKEN }}
# Так как раннер на том же сервере, образ уже закэширован, # Pull гарантирует, что мы получили нужную версию.
# но pull гарантирует, что compose подхватит именно свежий latest-тег.
docker compose pull bot web docker compose pull bot web
# Запускаем! Флаг -d оставит их работать в фоне. # Запускаем! Флаг -d оставит их работать в фоне.
# БД не перезапустится, так как её образ не менялся.
docker compose up -d docker compose up -d
+1
View File
@@ -1,5 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
+2 -2
View File
@@ -18,7 +18,7 @@ services:
retries: 10 retries: 10
bot: bot:
image: git.codeanddice.ru/toutsu/gmrelay-bot:latest image: git.codeanddice.ru/toutsu/gmrelay-bot:1.0.0
container_name: gmrelay_bot container_name: gmrelay_bot
restart: always restart: always
network_mode: host network_mode: host
@@ -30,7 +30,7 @@ services:
- "Telegram__BotToken=${TELEGRAM_BOT_TOKEN}" - "Telegram__BotToken=${TELEGRAM_BOT_TOKEN}"
web: web:
image: git.codeanddice.ru/toutsu/gmrelay-web:latest image: git.codeanddice.ru/toutsu/gmrelay-web:1.0.0
container_name: gmrelay_web container_name: gmrelay_web
restart: always restart: always
network_mode: host network_mode: host