feat: setup host deployment via ssh
All checks were successful
Deployment / deploy-to-host (push) Successful in 7s
All checks were successful
Deployment / deploy-to-host (push) Successful in 7s
This commit is contained in:
@@ -6,16 +6,37 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy-to-host:
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Deploy via SSH
|
||||||
uses: actions/checkout@v3
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
|
with:
|
||||||
|
host: 172.17.0.1 # Standard-IP des Docker-Hosts aus Sicht des Containers
|
||||||
|
username: root # Dein Deployment-Nutzer
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
script: |
|
||||||
|
mkdir -p /root/docker-files/trading-daemon
|
||||||
|
cd /root/docker-files/trading-daemon
|
||||||
|
|
||||||
- name: Setup Virtual Environment
|
# Repository klonen oder pullen
|
||||||
run: |
|
if [ ! -d ".git" ]; then
|
||||||
python3 -m venv venv
|
git clone https://git.bana.space/krumbelfix/trading-daemon.git .
|
||||||
./venv/bin/pip install -r requirements.txt
|
else
|
||||||
|
git pull origin main
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Notification
|
# Virtual Environment aktualisieren
|
||||||
run: echo "Code wurde erfolgreich auf $(hostname) aktualisiert. Systemd-Dienste müssen ggf. manuell neu gestartet werden."
|
python3 -m venv venv
|
||||||
|
./venv/bin/pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Systemd Update
|
||||||
|
cp systemd/trading-daemon.service /etc/systemd/system/
|
||||||
|
cp systemd/trading-daemon.timer /etc/systemd/system/
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# Neustart
|
||||||
|
systemctl restart trading-daemon.timer
|
||||||
|
systemctl start trading-daemon.service
|
||||||
|
|
||||||
|
echo "Deployment auf dem Host-System erfolgreich."
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
User=melchiorreimers
|
User=melchiorreimers
|
||||||
WorkingDirectory=/Users/melchiorreimers/.gemini/antigravity/scratch/trading_daemon
|
WorkingDirectory=/root/docker-files/trading-daemon
|
||||||
ExecStart=/Users/melchiorreimers/.gemini/antigravity/scratch/trading_daemon/venv/bin/python /Users/melchiorreimers/.gemini/antigravity/scratch/trading_daemon/daemon.py
|
ExecStart=/root/docker-files/trading-daemon/venv/bin/python /root/docker-files/trading-daemon/daemon.py
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
StandardError=journal
|
StandardError=journal
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user