name: Deploy PBT on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: rsync installieren run: apt-get update && apt-get install -y rsync openssh-client - name: SSH-Key als Datei anlegen run: | mkdir -p ~/.ssh printf '%s\n' "${{ secrets.PBT_DEPLOY_KEY }}" > ~/.ssh/pbt_deploy_key chmod 600 ~/.ssh/pbt_deploy_key ssh-keyscan -H pbt >> ~/.ssh/known_hosts - name: Dateien auf die pbt-LXC syncen run: | rsync -avz --delete \ -e "ssh -i ~/.ssh/pbt_deploy_key -o UserKnownHostsFile=~/.ssh/known_hosts" \ --exclude '.git' \ --exclude '.gitea' \ --exclude 'venv' \ --exclude '__pycache__' \ ./ deploy@pbt:/opt/pbt/ - name: Abhängigkeiten installieren & Service neu starten run: | ssh -i ~/.ssh/pbt_deploy_key -o UserKnownHostsFile=~/.ssh/known_hosts deploy@pbt ' set -e cd /opt/pbt python3 -m venv venv source venv/bin/activate pip install -q -r requirements.txt sudo /usr/bin/systemctl restart pbt '