# Using git-ftp to push changes to server
# "atlassian/ftp-deploy" pushes every file every time and deletes untracked files (not the desired behaviour we want)
# git-ftp only updates tracked files 
image: wagnerstephan/bitbucket-git-ftp:latest

pipelines:
  branches:
    develop:
      - step:
          caches:
            - node
          deployment: Staging
          script:
            - git reset --hard
            - git ftp push -u "$SFTP_USER" -p "$SFTP_PASS" ftp://$SFTP_HOST/public_html/uat
    # master:
    #   - step:
    #       caches:
    #         - node
    #       deployment: Production
    #       script:
    #         - git reset --hard
    #         - git ftp push -u "$SFTP_USER" -p "$SFTP_PASS" ftp://$SFTP_HOST/public_html