Directory not found on AWS S3 deploy (version 2)

Hello guys, i’m facing a deploy problem with version 2.

If i run aws s3 sync dist s3://jfront --delete to deploy my app the following error is throw:

The user-provided path dist does not exist.

I have 2 jobs and one workflow. The build-job bundle the app on dist directory. The deploy-job deploy dist folder to s3. How can i make this work?

Thanks.

My config:

version: 2
jobs:
  build-job:
    docker:
      - image: circleci/node:7.10
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: yarn install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run: yarn lint
      - run: yarn test
      - run: yarn build

  deploy-job:
    docker:
      - image: circleci/node:7.10
    working_directory: ~/repo
    steps:
      - run:
          name: Install Python
          command: sudo apt-get install python3 python-pip python-dev
      - run:
          name: Install awscli
          command: sudo pip install awscli
      - run:
          name: Deploy to S3 jfront bucket
          command: aws s3 sync dist s3://jfront --delete
workflows:
  version: 2
  build-deploy:
    jobs:
      - build-job
      - deploy-job:
          requires:
            - build-job
          filters:
            branches:
              only: master
1 Like

I think you need to use workspaces to share the dist directory between the build-job and the deploy-job.

1 Like

Thx @levlaz, it solves the problem

1 Like