This commit is contained in:
parent
ab41fbea38
commit
96c05ca7af
38
.gitea/workflows/deploy.yml
Normal file
38
.gitea/workflows/deploy.yml
Normal 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
|
13
TgBots/.idea/.idea.TgBots/.idea/.gitignore
generated
vendored
13
TgBots/.idea/.idea.TgBots/.idea/.gitignore
generated
vendored
@ -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
|
|
4
TgBots/.idea/.idea.TgBots/.idea/encodings.xml
generated
4
TgBots/.idea/.idea.TgBots/.idea/encodings.xml
generated
@ -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>
|
|
8
TgBots/.idea/.idea.TgBots/.idea/indexLayout.xml
generated
8
TgBots/.idea/.idea.TgBots/.idea/indexLayout.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="UserContentModel">
|
|
||||||
<attachedFolders />
|
|
||||||
<explicitIncludes />
|
|
||||||
<explicitExcludes />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
Loading…
Reference in New Issue
Block a user