Update .gitea/workflows/ftp_deploy.yml/ftp_deploy.yml

This commit is contained in:
ravigulhane 2026-05-22 05:13:10 +00:00
parent 2aa58d22de
commit 68794c9a97
1 changed files with 19 additions and 24 deletions

View File

@ -1,4 +1,4 @@
name: Local to Remote RSYNC Deploy name: Specific Folder FTP Upload
on: on:
push: push:
@ -8,27 +8,22 @@ on:
- 'resources/views/form/**' - 'resources/views/form/**'
jobs: jobs:
deploy: ftp-deploy:
runs-on: host # 👈 Change from 'ubuntu-latest' to 'host' runs-on: ubuntu-latest
steps: steps:
- name: Fetch Locally and RSYNC to Remote VPS # 1. Checkout the repository code fully
run: | - name: Checkout Repository
echo "📂 1. Navigating to local directory..." uses: actions/checkout@v4
cd /var/www/rapport with:
fetch-depth: 0
echo "🔄 2. Fetching latest changes from Gitea down to local..." # 2. Sync the targeted folder using the corrected rsync args
git fetch origin main - name: Sync Changed Files via SFTP
git reset --hard origin/main uses: easingthemes/ssh-deploy@v5.1.0
with:
echo "🔒 3. Securing SSH Key permissions for the sync..." SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# Enforces strict owner-only permissions so SSH doesn't reject the key REMOTE_HOST: '157.245.101.206'
chmod 600 /home/swtserver/ravimac REMOTE_USER: 'root'
SOURCE: 'resources/views/form' # 👈 Removed trailing slash
echo "🚚 4. Pushing changes from local folder to the remote server..." TARGET: '/var/www/rapport/resources/views/' # 👈 Point to parent folder
# Uses lowercase verbose flags and parent-folder directory target mapping ARGS: '-rlgodivzc' # 👈 Fixed: changed to lowercase verbose mode, removed capital V
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!"