Posodobitev workflow datoteke za uporabo SSH ključa in dostop do ciljnega strežnika
Deploy to Test Server / deploy (push) Failing after 4s

This commit is contained in:
Mark Poljanšek committed 2025-06-22 13:38:06 +02:00
1 parent 1ff421ece2
commit 14cddf9a0c
2 files changed
+16 -29

No files matched your search

+12 -29
View File
@@ -13,32 +13,15 @@ jobs:
uses: actions/checkout@v2
- name: Deploy to test server
uses: appleboy/ssh-action@master
with:
host: 152.89.234.215
port: 5050
username: forexana
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
# Izbrišemo obstoječo vsebino v mapi vtičnika
rm -rf test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/*
# Ustvarimo začasno mapo za kopiranje
mkdir -p /tmp/wheel_deploy
# Počistimo začasno mapo
rm -rf /tmp/wheel_deploy/*
# Kopiramo novo vsebino v začasno mapo
cp -r $GITHUB_WORKSPACE/* /tmp/wheel_deploy/
# Kopiramo iz začasne mape v ciljno mapo vtičnika
cp -r /tmp/wheel_deploy/* test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/
# Nastavimo pravilna dovoljenja
chmod -R 755 test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/
# Počistimo začasno mapo
rm -rf /tmp/wheel_deploy
echo "Deployment completed successfully!"
shell: bash
run: |
# Izbrišemo obstoječo vsebino v mapi vtičnika
ssh -p 5050 -i $GITHUB_WORKSPACE/.gitea/runner/id_rsa_gitea -o StrictHostKeyChecking=no forexana@152.89.234.215 "rm -rf test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/*"
# Naredimo direktno kopiranje z rsync
rsync -avz -e "ssh -p 5050 -i $GITHUB_WORKSPACE/.gitea/runner/id_rsa_gitea -o StrictHostKeyChecking=no" --exclude=".git" --exclude=".gitea" --exclude="id_rsa_gitea*" ./ forexana@152.89.234.215:test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/
# Nastavimo pravilna dovoljenja
ssh -p 5050 -i $GITHUB_WORKSPACE/.gitea/runner/id_rsa_gitea -o StrictHostKeyChecking=no forexana@152.89.234.215 "chmod -R 755 test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/"
echo "Deployment completed successfully!"