From 53f249df708e931f41163cfaee07c7967cafde3e Mon Sep 17 00:00:00 2001 From: ravigulhane Date: Fri, 22 May 2026 05:01:36 +0000 Subject: [PATCH] Update .gitea/workflows/ftp_deploy.yml/ftp_deploy.yml --- .../workflows/ftp_deploy.yml/ftp_deploy.yml | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/ftp_deploy.yml/ftp_deploy.yml b/.gitea/workflows/ftp_deploy.yml/ftp_deploy.yml index 46b8431c..b32da125 100644 --- a/.gitea/workflows/ftp_deploy.yml/ftp_deploy.yml +++ b/.gitea/workflows/ftp_deploy.yml/ftp_deploy.yml @@ -1,32 +1,34 @@ -name: Specific Folder FTP Upload +name: Local to Remote RSYNC Deploy on: push: branches: - - main # Change this if your default branch is master + - main paths: - - 'resources/views/form/**' # 👈 CHANGE THIS to your folder name + - 'resources/views/form/**' jobs: - ftp-deploy: + deploy: runs-on: ubuntu-latest steps: - # 1. Checkout the code - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 2 # Fetches the current and previous commit to calculate differences - - # 2. Extract and Upload only the changed files - - name: Sync Changed Files via SFTP - uses: easingthemes/ssh-deploy@v5.1.0 - with: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - REMOTE_HOST: '157.245.101.206' - REMOTE_USER: 'root' - # 👇 Fixed: Points rsync to the exact source within the checkout space - # 👇 Fixed: Using a relative dot-notation path to align with the plugin's internal root mapping - SOURCE: './resources/views/form/' - TARGET: '/var/www/rapport/resources/views/form/' - # 👇 Added explicitly to prevent scanning node_modules/vendor completely - ARGS: '-rlgoDIVzcv' \ No newline at end of file + - name: Fetch Locally and RSYNC to Remote VPS + run: | + echo "📂 1. Navigating to local directory..." + cd /var/www/rapport + + echo "🔄 2. Fetching latest changes from Gitea down to local..." + git fetch origin main + git reset --hard origin/main + + echo "🔒 3. Securing SSH Key permissions for the sync..." + # Enforces strict owner-only permissions so SSH doesn't reject the key + chmod 600 /home/swtserver/ravimac + + echo "🚚 4. Pushing changes from local folder to the remote server..." + # Uses lowercase verbose flags and parent-folder directory target mapping + rsync -rlgodivzc \ + -e "ssh -p 22 -i /home/swtserver/ravimac -o StrictHostKeyChecking=no" \ + resources/views/form \ + root@157.245.101.206:/var/www/rapport/resources/views/ + + echo "✨ Remote deployment successful!" \ No newline at end of file