title: How do I SCP repo files using GitHub Actions?
body: <p>I'm trying to implement a GitHub action that will SCP my repo files to a server on a push to the master branch. I have a similar setup working on Bitbucket Pipelines, but now that I'm learning to do this with GitHub actions, I'm not having any luck.</p>
  
  <p>My project is a simple <a href="https://github.com/SamSverko/flatbread" rel="noreferrer">Node.js app</a>, where I would like to simply scp all the files to the server, then I will run a post-scp script to <code>npm i</code> once the new files are copied to the server. Just want to keep things simple while I'm learning.</p>
  
  <p>I'm using the <a href="https://github.com/marketplace/actions/scp-files" rel="noreferrer">scp-files GitHub Action</a>. Here is my file:</p>
  
  <pre><code>name: Deploy to production
  
  on:
    push:
      branches:
        - master
    pull_request:
      branches:
        - master
  jobs:
    deploy:
      name: SCP files to server
      runs-on: ubuntu-latest
      steps:
        - name: SCP files via ssh key
          uses: appleboy/scp-action@master
          env:
            USERNAME: ${{ secrets.USERNAME }}
            HOST: ${{ secrets.HOST }}
            KEY: ${{ secrets.SSH_DEPLOYMENT_KEY }}
          with:
            source: './*'
            target: '/home/ubuntu/flatbread/'
  </code></pre>
  
  <p>This action is able to complete the <code>Set up job</code> and <code>Build appleboy/scp-action@master</code>. But it errors out when it runs <code>appleboy/scp-action@master</code>. This is the error I receive:</p>
  
  <pre><code>tar: empty archive
  exit status 1
  tar all files into /tmp/320558105/i2yG360Zje.tar
  ##[error]Docker run failed with exit code 1
  </code></pre>
  
  <p>I'm not quite sure what I am doing wrong. Even if I change the <code>source: './*'</code> to a sample folder (i.e. <code>source: app</code>), it still gives me the same error.</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>If I change the <code>source: './*'</code> to <code>source: '.'</code>, that seems to do the trick in terms of no more GitHub action errors:</p>
  
  <pre><code>tar all files into /tmp/719605837/1uYygkf4Vn.tar
  scp file to server.
  create folder /home/***/flatbread/
  untar file 1uYygkf4Vn.tar
  remove file 1uYygkf4Vn.tar
  ================================================
  Successfully executed transfer data to all host.
  ================================================
  </code></pre>
  
  <p>Unfortunately, upon verifying the files on the server, no changes have been made to it. Any ideas why that is?</p>