Переделал
Some checks are pending
Local Deploy with Docker / build-and-deploy (push) Waiting to run

This commit is contained in:
Dmitrii Prokudin 2024-12-25 04:43:22 +03:00
parent ab41fbea38
commit 96c05ca7af
25 changed files with 38 additions and 25 deletions

View File

@ -0,0 +1,38 @@
name: Local Deploy with Docker
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
# 1. Checkout репозиторий
- name: Checkout Repository
uses: actions/checkout@v3
# 2. Сборка Docker-образа
- name: Build Docker Image
run: |
docker build -t telegram-bot:latest .
# 3. Остановка и удаление старого контейнера (если существует)
- name: Stop and Remove Existing Container
run: |
docker stop telegram-bot || true
docker rm telegram-bot || true
# 4. Запуск нового контейнера
- name: Run New Docker Container
run: |
docker run -d --name telegram-bot \
--restart=always \
-e DATABASE_HOST=localhost \
-e DATABASE_NAME=telegram_bot \
-e DATABASE_USER=postgres \
-e DATABASE_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e BOT_TOKEN=${{ secrets.BOT_TOKEN }} \
telegram-bot:latest

View File

@ -1,13 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/projectSettingsUpdater.xml
/.idea.TgBots.iml
/modules.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>