Switch master deploy to FTP
Deploy to Development and Production / deploy (push) Failing after 7s
Details
Deploy to Development and Production / deploy (push) Failing after 7s
Details
This commit is contained in:
parent
7cbb17594e
commit
c0462c911a
|
|
@ -38,14 +38,28 @@ jobs:
|
|||
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.TARGET_DIR }}
|
||||
|
||||
# 4. KORAK ZA MASTER: Izvede se samo, če je veja 'master'
|
||||
- name: Deploy to Production Server
|
||||
- name: Install lftp (master only)
|
||||
if: gitea.ref_name == 'master'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y lftp
|
||||
|
||||
- name: Deploy to Production Server (FTP)
|
||||
if: gitea.ref_name == 'master'
|
||||
run: |
|
||||
echo "🚀 Deploying to Production..."
|
||||
rsync -avz --delete \
|
||||
--exclude=".git/" \
|
||||
--exclude=".gitea/" \
|
||||
--exclude=".gitignore" \
|
||||
-e "ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no" \
|
||||
./ \
|
||||
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.TARGET_MASTER_DIR }}
|
||||
lftp -c "
|
||||
set ftp:ssl-allow no
|
||||
set ftp:passive-mode yes
|
||||
open -u ${FTP_USER},${FTP_PASS} ${FTP_HOST}
|
||||
mirror -R --delete --verbose \
|
||||
--exclude-glob .git/ \
|
||||
--exclude-glob .gitea/ \
|
||||
--exclude-glob .gitignore \
|
||||
./ ${TARGET_MASTER_DIR}
|
||||
"
|
||||
env:
|
||||
FTP_HOST: ${{ secrets.FTP_HOST }}
|
||||
FTP_USER: ${{ secrets.FTP_USER }}
|
||||
FTP_PASS: ${{ secrets.FTP_PASS }}
|
||||
TARGET_MASTER_DIR: ${{ secrets.TARGET_MASTER_DIR }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue