Hi guys,
I’m new to Circle.CI. I started to write my config yml file. All is working as expected in my React app, ie. circle install my dependencies with yarn, it builds the app as well. The one step I’m still missing is to deploy it to the external server. I’m using ssh to connect to it. I did upload private key to circle and public key to my server. So that is for sure correct. I think my syntax though is wrong:
    version: 2
defaults: &defaults
  working_directory: /home/circleci/Przygody_front
  docker:
    - image: circleci/node:8.11
jobs:
  dependencies:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: yarn install --frozen-lockfile
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - persist_to_workspace:
          root: /home/circleci
          paths:
            - Przygody_front
    
  build:
    <<: *defaults
    steps:
      - attach_workspace:
          at: /home/circleci
      - run: CI=false yarn build
      - persist_to_workspace:
          root: /home/circleci
          paths:
            - Przygody_front/build
  deploy:
    <<: *defaults
    steps:
      - attach_workspace:
          at: /home/circleci
      - add_ssh_keys
      - run: echo 'THE FINGERPRINT' >> ~/.ssh/known_hosts
      - run: scp /home/circleci/Przygody_front/build ssh -o StrictHostKeyChecking=no votumsma@votumsma.smarthost.pl:/www/malewielkieprzygody.pl -p 222
workflows:
  version: 2
  dependencies_and_build:
    jobs:
      - dependencies
      - build:
          requires:
            - dependencies
      - deploy
I guess the line with scp is wrong, I’m having error:
#!/bin/bash -eo pipefail scp /home/circleci/Przygody_front/build ssh -o StrictHostKeyChecking=no votumsma@votumsma.smarthost.pl:/www/malewielkieprzygody.pl -p 222
222: No such file or directory Exited with code 1
Thank you in advance!