Search code examples
githubsshgithub-actionsrsync

Github repository is empty when rsync is used


I have added workflow to github actions where i want to rsync files from repository to remote server


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy with rsync
        run: rsync -avuz --delete . ${{ secrets.USER }}@${{ secrets.HOST }}:~/App/MainPage/

rsync sends nothing because my repository in source folder is empty, even though there are files in repo.

enter image description here

i get this message

enter image description here

I know that rsync works, because if i change dir (eg ../../) files are being transferred to remote server and i can see them there.

enter image description here


Solution

  • I forgot to add checkout action to workflow .yaml file

    ...
    jobs:
      build:
        runs-on: ubuntu-latest
    
        steps:
          # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
          - uses: actions/checkout@v3
    
          - name: Install SSH Key
            uses: shimataro/ssh-key-action@v2
    ....