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