Without ssh-workarounds
Deploy PBT / deploy (push) Successful in 13s

This commit is contained in:
2026-09-09 19:57:34 +02:00
parent 26dd392785
commit b26bc9c34f
+8 -16
View File
@@ -4,9 +4,6 @@ on:
push: push:
branches: [main] branches: [main]
env:
HOME: /root
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -15,24 +12,19 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: rsync installieren - name: rsync installieren
run: apt-get update && apt-get install -y rsync openssh-client run: apt-get update && apt-get install -y rsync
- name: SSH-Key als Datei anlegen - name: SSH-Key laden
run: | uses: webfactory/ssh-agent@v0.9.0
mkdir -p /root/.ssh with:
printf '%s\n' "${{ secrets.PBT_DEPLOY_KEY }}" > /root/.ssh/pbt_deploy_key ssh-private-key: ${{ secrets.PBT_DEPLOY_KEY }}
chmod 600 /root/.ssh/pbt_deploy_key
ssh-keyscan -H pbt >> /root/.ssh/known_hosts
- name: Key-Inhalt verifizieren (Debug) - name: Host-Key vertrauen
run: | run: ssh-keyscan -H pbt >> ~/.ssh/known_hosts
echo "Abgeleiteter Public Key aus dem geschriebenen Private Key:"
ssh-keygen -y -f /root/.ssh/pbt_deploy_key || echo "FEHLER: Datei ist kein gültiger Private Key"
- name: Dateien auf die pbt-LXC syncen - name: Dateien auf die pbt-LXC syncen
run: | run: |
rsync -avz --delete \ rsync -avz --delete \
-e "ssh -i /root/.ssh/pbt_deploy_key -o UserKnownHostsFile=/root/.ssh/known_hosts" \
--exclude '.git' \ --exclude '.git' \
--exclude '.gitea' \ --exclude '.gitea' \
--exclude 'venv' \ --exclude 'venv' \
@@ -41,7 +33,7 @@ jobs:
- name: Abhängigkeiten installieren & Service neu starten - name: Abhängigkeiten installieren & Service neu starten
run: | run: |
ssh -i /root/.ssh/pbt_deploy_key -o UserKnownHostsFile=/root/.ssh/known_hosts deploy@pbt ' ssh deploy@pbt '
set -e set -e
cd /opt/pbt cd /opt/pbt
python3 -m venv venv python3 -m venv venv