Update .gitea/workflows/ftp_deploy.yml/ftp_deploy.yml
This commit is contained in:
parent
e0ee64e7f1
commit
53f249df70
|
|
@ -1,32 +1,34 @@
|
||||||
name: Specific Folder FTP Upload
|
name: Local to Remote RSYNC Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # Change this if your default branch is master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'resources/views/form/**' # 👈 CHANGE THIS to your folder name
|
- 'resources/views/form/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ftp-deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# 1. Checkout the code
|
- name: Fetch Locally and RSYNC to Remote VPS
|
||||||
- name: Checkout Repository
|
run: |
|
||||||
uses: actions/checkout@v4
|
echo "📂 1. Navigating to local directory..."
|
||||||
with:
|
cd /var/www/rapport
|
||||||
fetch-depth: 2 # Fetches the current and previous commit to calculate differences
|
|
||||||
|
|
||||||
# 2. Extract and Upload only the changed files
|
echo "🔄 2. Fetching latest changes from Gitea down to local..."
|
||||||
- name: Sync Changed Files via SFTP
|
git fetch origin main
|
||||||
uses: easingthemes/ssh-deploy@v5.1.0
|
git reset --hard origin/main
|
||||||
with:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
echo "🔒 3. Securing SSH Key permissions for the sync..."
|
||||||
REMOTE_HOST: '157.245.101.206'
|
# Enforces strict owner-only permissions so SSH doesn't reject the key
|
||||||
REMOTE_USER: 'root'
|
chmod 600 /home/swtserver/ravimac
|
||||||
# 👇 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
|
echo "🚚 4. Pushing changes from local folder to the remote server..."
|
||||||
SOURCE: './resources/views/form/'
|
# Uses lowercase verbose flags and parent-folder directory target mapping
|
||||||
TARGET: '/var/www/rapport/resources/views/form/'
|
rsync -rlgodivzc \
|
||||||
# 👇 Added explicitly to prevent scanning node_modules/vendor completely
|
-e "ssh -p 22 -i /home/swtserver/ravimac -o StrictHostKeyChecking=no" \
|
||||||
ARGS: '-rlgoDIVzcv'
|
resources/views/form \
|
||||||
|
root@157.245.101.206:/var/www/rapport/resources/views/
|
||||||
|
|
||||||
|
echo "✨ Remote deployment successful!"
|
||||||
Loading…
Reference in New Issue