From 14cddf9a0cc0c2f68023b16b90f24c4676c99d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Poljan=C5=A1ek?= Date: Sun, 22 Jun 2025 13:38:06 +0200 Subject: [PATCH] =?UTF-8?q?Posodobitev=20workflow=20datoteke=20za=20uporab?= =?UTF-8?q?o=20SSH=20klju=C4=8Da=20in=20dostop=20do=20ciljnega=20stre?= =?UTF-8?q?=C5=BEnika?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy-to-test.yml | 41 +++++++++-------------------- .gitignore | 4 +++ 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/.gitea/workflows/deploy-to-test.yml b/.gitea/workflows/deploy-to-test.yml index 4c6ccbf..374c087 100644 --- a/.gitea/workflows/deploy-to-test.yml +++ b/.gitea/workflows/deploy-to-test.yml @@ -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!" \ No newline at end of file + 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!" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 794b2e5..f017775 100644 --- a/.gitignore +++ b/.gitignore @@ -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