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