Help with Angular deploy

Hi.

I’m trying to deploy an Angular Application in a FTP Server.
But everytime it gets into the deploy job, it uploads all angular files.
I only want the dist folder.

How can i do this?

version: 2
jobs:
  build:
    working_directory: ~/test-angular'
    docker:
      - image: circleci/node:12-browsers
    steps:
      - checkout
      - restore_cache:
          key: test-angular-{{ .Branch }}-{{ checksum "package-lock.json" }}
      - run: npm ci
      - save_cache:
          key: test-angular-{{ .Branch }}-{{ checksum "package-lock.json" }}
          paths:
            - ~/.npm
            - ~/.cache
      - run: |
          if [ "${CIRCLE_BRANCH}" == "master" ]; then
            npm run build
          fi
      - persist_to_workspace:
          root: ~/test-angular
          paths:
            - dist/*
  deploy:
    working_directory: ~/test-angular
    docker:
      - image: circleci/node:12-browsers
    steps:
      - checkout
      - run:
          name: "Deploy to Masterr"
          command: |
            if [ "${CIRCLE_BRANCH}" = "master" ]; then
              sudo apt-get update
              sudo apt-get -qq install git-ftp
              echo "Deploying project..."
              echo $(git status)
              git ftp init --user "${FTP_USER}" --passwd "${FTP_PWD}" ${FTP_LOCATION}
            else
              echo -e "Not master branch so not deploying";
            fi

workflows:
  version: 2
  build_deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only:
                - master

So I’m not sure this is the full issue, but it looks like it’s deploying to ${FTP_LOCATION} whatever is in the current folder you’re in?

${FTP_LOCATION} is the enviroment variable that shows where the files will stay.
The problem is after the build job, it needs to upload to the same location only the /dist/* files.
But with this config.yml, circleci uploads everything (the source code).