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:
|
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..."
|
|
||||||
git fetch origin main
|
# 2. Sync the targeted folder using the corrected rsync args
|
||||||
git reset --hard origin/main
|
- name: Sync Changed Files via SFTP
|
||||||
|
uses: easingthemes/ssh-deploy@v5.1.0
|
||||||
echo "🔒 3. Securing SSH Key permissions for the sync..."
|
with:
|
||||||
# Enforces strict owner-only permissions so SSH doesn't reject the key
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
chmod 600 /home/swtserver/ravimac
|
REMOTE_HOST: '157.245.101.206'
|
||||||
|
REMOTE_USER: 'root'
|
||||||
echo "🚚 4. Pushing changes from local folder to the remote server..."
|
SOURCE: 'resources/views/form' # 👈 Removed trailing slash
|
||||||
# Uses lowercase verbose flags and parent-folder directory target mapping
|
TARGET: '/var/www/rapport/resources/views/' # 👈 Point to parent folder
|
||||||
rsync -rlgodivzc \
|
ARGS: '-rlgodivzc' # 👈 Fixed: changed to lowercase verbose mode, removed capital V
|
||||||
-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!"
|
|
||||||
Loading…
Reference in New Issue