# Alternative deployment methods if FTP fails

# Option 1: SFTP Deployment (if server only supports SFTP)
- name: Deploy via SFTP
  uses: wlixcc/SFTP-Deploy-Action@v1.2.4
  with:
    server: ${{ secrets.CPANEL_FTP_SERVER }}
    username: ${{ secrets.CPANEL_FTP_USERNAME }}
    password: ${{ secrets.CPANEL_FTP_PASSWORD }}
    port: 22
    local_path: './deploy/*'
    remote_path: ${{ secrets.CPANEL_SERVER_DIR }}

# Option 2: SCP Deployment
- name: Deploy via SCP
  uses: appleboy/scp-action@v0.1.7
  with:
    host: ${{ secrets.CPANEL_FTP_SERVER }}
    username: ${{ secrets.CPANEL_FTP_USERNAME }}
    password: ${{ secrets.CPANEL_FTP_PASSWORD }}
    port: 22
    source: "deploy/*"
    target: ${{ secrets.CPANEL_SERVER_DIR }}

# Option 3: Rsync over SSH
- name: Deploy via Rsync
  uses: burnett01/rsync-deployments@6.0.0
  with:
    switches: -avzr --delete
    path: deploy/
    remote_path: ${{ secrets.CPANEL_SERVER_DIR }}
    remote_host: ${{ secrets.CPANEL_FTP_SERVER }}
    remote_user: ${{ secrets.CPANEL_FTP_USERNAME }}
    remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
