43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Deployment
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy-to-host:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy via SSH
|
|
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
|
|
|
|
# Repository klonen oder pullen
|
|
if [ ! -d ".git" ]; then
|
|
git clone https://git.bana.space/krumbelfix/trading-daemon.git .
|
|
else
|
|
git pull origin main
|
|
fi
|
|
|
|
# Virtual Environment aktualisieren
|
|
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."
|