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

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

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: |
shell: bash
run: |
# Izbrišemo obstoječo vsebino v mapi vtičnika
rm -rf test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/*
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/*"
# 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/
# 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
chmod -R 755 test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/
# Počistimo začasno mapo
rm -rf /tmp/wheel_deploy
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!"

4
.gitignore vendored
View File

@ -13,6 +13,10 @@ Thumbs.db
*.sublime-project
*.sublime-workspace
# SSH ključi
id_rsa_*
.gitea/runner/id_rsa_*
# WordPress specific files
*.log
wp-config.php