diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 8ecbf7c..6b2c59e 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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 }} \ No newline at end of file + 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 }}