diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index fae489e..68876ce 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -5,6 +5,9 @@ on: branches: - main +env: + VERSION: 1.0.0 + jobs: # ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами) build-and-push: @@ -26,7 +29,9 @@ jobs: context: . file: src/GmRelay.Bot/Dockerfile 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: | org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }} @@ -36,7 +41,9 @@ jobs: context: . file: src/GmRelay.Web/Dockerfile 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: | org.opencontainers.image.source=https://git.codeanddice.ru/${{ gitea.repository }} @@ -59,10 +66,8 @@ jobs: # Авторизуемся локальным докером в нашей Gitea docker login git.codeanddice.ru/ -u toutsu -p ${{ secrets.GIT_TOKEN }} - # Так как раннер на том же сервере, образ уже закэширован, - # но pull гарантирует, что compose подхватит именно свежий latest-тег. + # Pull гарантирует, что мы получили нужную версию. docker compose pull bot web # Запускаем! Флаг -d оставит их работать в фоне. - # БД не перезапустится, так как её образ не менялся. docker compose up -d \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 6598721..d1ee971 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,6 @@ + 1.0.0 net10.0 preview enable diff --git a/compose.yaml b/compose.yaml index 8e0128e..786bd4f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -18,7 +18,7 @@ services: retries: 10 bot: - image: git.codeanddice.ru/toutsu/gmrelay-bot:latest + image: git.codeanddice.ru/toutsu/gmrelay-bot:1.0.0 container_name: gmrelay_bot restart: always network_mode: host @@ -30,7 +30,7 @@ services: - "Telegram__BotToken=${TELEGRAM_BOT_TOKEN}" web: - image: git.codeanddice.ru/toutsu/gmrelay-web:latest + image: git.codeanddice.ru/toutsu/gmrelay-web:1.0.0 container_name: gmrelay_web restart: always network_mode: host