title: How to deploy react app in ubuntu server with bitbucket pipeline
body: <p>I want to build and deploy my <code>react app</code> from my <code>master</code> branch I have managed to automate build but unable to transfer it into my server find my <code>pipeline code</code> below, I receive below error</p>
  <pre><code>pipelines:
    default:
      - step:
          name: Build Title
          script:
            - npm install
            - npm run build
            - mkdir packaged
            - tar -czvf packaged/package-${BITBUCKET_BUILD_NUMBER}.tar.gz -C build .
          artifacts:
            - packaged/**
      - step:
          name: Deploy to Web
          image: alpine
          trigger: manual
          deployment: production
          script:
            - mkdir upload
            - tar -xf packaged/package-${BITBUCKET_BUILD_NUMBER}.tar.gz -C upload
            - apk update &amp;&amp; apk add openssh rsync
            - rsync -a  -e &quot;ssh -o StrictHostKeyChecking=no&quot; --delete upload/ $USERNAME@$SERVER:html/temp/react-${BITBUCKET_BUILD_NUMBER}
            - ssh -o StrictHostKeyChecking=no $USERNAME@$SERVER &quot;rm -r html/www&quot;
            - ssh -o StrictHostKeyChecking=no $USERNAME@$SERVER &quot;mv 'html/temp/react-${BITBUCKET_BUILD_NUMBER}' 'var/www/html/deploy'&quot;
            - ssh -o StrictHostKeyChecking=no $USERNAME@$SERVER &quot;chmod -R u+rwX,go+rX,go-w html/www&quot;
  </code></pre>
  <p><strong>Error Log</strong></p>
  <pre><code>+ rsync -a  -e &quot;ssh -o StrictHostKeyChecking=no&quot; --delete upload/ $USERNAME@$SERVER:html/temp/react-${BITBUCKET_BUILD_NUMBER}
  load pubkey &quot;/opt/atlassian/pipelines/agent/ssh/id_rsa&quot;: invalid format
  rsync: mkdir &quot;/$USERNAME/html/temp/react-15&quot; failed: No such file or directory (2)
  rsync error: error in file IO (code 11) at main.c(675) [Receiver=3.1.2]
  </code></pre>