# Azure Pipeline for FTP Deployment to cPanel

trigger:
  branches:
    include:
      - main
      - master

pool:
  vmImage: "ubuntu-latest"

steps:
  - checkout: self
    clean: true

  - task: FtpUpload@2
    displayName: "Deploy to cPanel via FTP"
    inputs:
      credentialsOption: "inputs"
      serverUrl: "$(FTP_HOST)"
      username: "$(FTP_USER)"
      password: "$(FTP_PASSWORD)"
      rootDirectory: "$(System.DefaultWorkingDirectory)"
      filePatterns: |
        **/*
        !**/.git/**
        !**/.github/**
        !**/.vscode/**
        !**/node_modules/**
        !**/.env
        !**/README.md
        !**/azure-pipelines.yml
      remoteDirectory: "$(REMOTE_DIR)"
      clean: false
      cleanContents: false
      preservePaths: true
      trustSSL: true
