Update .gitea/workflows/ftp_deploy.yml/ftp_deploy.yml
This commit is contained in:
parent
2aa58d22de
commit
68794c9a97
|
|
@ -1,4 +1,4 @@
|
|||
name: Local to Remote RSYNC Deploy
|
||||
name: Specific Folder FTP Upload
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -8,27 +8,22 @@ on:
|
|||
- 'resources/views/form/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: host # 👈 Change from 'ubuntu-latest' to 'host'
|
||||
ftp-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Locally and RSYNC to Remote VPS
|
||||
run: |
|
||||
echo "📂 1. Navigating to local directory..."
|
||||
cd /var/www/rapport
|
||||
# 1. Checkout the repository code fully
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
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!"
|
||||
# 2. Sync the targeted folder using the corrected rsync args
|
||||
- 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'
|
||||
SOURCE: 'resources/views/form' # 👈 Removed trailing slash
|
||||
TARGET: '/var/www/rapport/resources/views/' # 👈 Point to parent folder
|
||||
ARGS: '-rlgodivzc' # 👈 Fixed: changed to lowercase verbose mode, removed capital V
|
||||
Loading…
Reference in New Issue