Burnett01/rsync-deployments

(GitTea) No files are copied

Closed this issue ยท 6 comments

Hello,

Job is executed but nothing happens 0 file is copied, could anybody help me with this issue ?
thanks in advance!

image

`name: Deployment
run-name: ${{ gitea.actor }} is testing out Gitea Actions ๐Ÿš€
on: [push]

jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Install rsync
run: |
apt-get -y update && apt-get -y install rsync

  - name: Check out repository code
    uses: actions/checkout@v3
    with:
      token: '${{ secrets.token }}'

  - name: List all files
    run: |
      ls -l
      pwd

  # https://github.com/Burnett01/rsync-deployments
  - name: ๐Ÿ“‚ Sync files
    uses: https://github.com/Burnett01/rsync-deployments@6.0.0
    with:
      switches: -avzr --delete --exclude=".git" --exclude=".github" --checksum
      path: /
      remote_path: /var/www/*****/test/
      remote_host: ****
      remote_port: ****
      remote_user: ****
      remote_key: ${{ secrets.SSH_KEY }}

`

I'm experiencing the exact same issue as described above. Here's an example my workflow yaml:

name: My Job
on: [push]

jobs:
  my_job:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Rsync Deploy
        uses: burnett01/rsync-deployments@6.0.0
        with:
          switches: -vzrn --delete --exclude ****
          remote_path: /var/****
          remote_host: ****
          remote_user: ****
          remote_key: ****

With this specific example, it is deleting all the files in the remote directory (except the excluded one) and not uploading any local files that were checked out in the checkout step above it. I've verified that the files are pulled down from git by adding an ls step in the workflow.

@GamerClassN7 I noticed that you were running this in Gitea Actions, as am I. This may be unexpected behavior specific to Gitea Runners or Act, not this project. I don't have enough information to make that conclusion, but it's worth noting. Let me know if you come across any resolution to this.

I was having a very similar issue with sftp-deploy which makes me believe this issue might be outside of the scope of this project.

To check if the rsync-deployments container ever received the files from git checkout, I docker execed into it and found that none of the repo files are mounted into the container. I then docker execed into the main runner container to ensure that the git files were checked out, which they were. Not sure what's causing them to not be available in the rsync-deployments container, but I was able to ensure that they weren't there.

Image

To check if the rsync-deployments container ever received the files from git checkout, I docker execed into it and found that none of the repo files are mounted into the container. I then docker execed into the main runner container to ensure that the git files were checked out, which they were. Not sure what's causing them to not be available in the rsync-deployments container, but I was able to ensure that they weren't there.

Image

I was bricked on the same thing you need to fiddle with your runner config

I was bricked on the same thing you need to fiddle with your runner config

Do you have an example?

Hey guys,

unfortunately I have no insight on how this action works in combination with GitTea.
Its primary use scope is Github and the Github Actions ecosystem, as outlined by the examples in the readme.

I used your switches on my test deployment repo and it works without problems on my end:
(switches: -avzr --delete --exclude=".git" --exclude=".github" --checksum)

image image

Maybe this is a problem specifically bound to GitTea and its deployment ecosystem.

I'm adding the "help wanted" tag so that users can gather here and discuss similar problems/solutions in this ticket.

Greetings, Steven

rimary use scope is Github and the Github Actions ecosystem, as outlined by the examples in the readme.

I used your switches on my test deployment repo and it works without problems on my

In the end i was able to use raw rsync to do similar think and it works maybe it can help others with understanding what is wrong, In general Gitea Actions are 1:1 copy of github one even interoperable from my knowledge.

Here is my deployment file for Laravel project :)

name: Deployment
run-name: ${{ gitea.actor }} is deploing new version on ${{ secrets.SSH_HOST }} ๐Ÿš€
on:
  push:
    branches:
      - master
    #tags:
    #  - '*'

jobs:
  Deploy-SFTP:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3
        with:
          token: '${{ secrets.token }}'
      - run: |
          ls
      - name: Install Rsync
        run: |
          apt update
          apt install rsync -y
      - name: Rsync Deploy
        env:
          # define SSH/Rsync destination environment var
          dest: "${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.REMOTE_PATH }}"
        run: |
            echo "${{ secrets.SSH_KEY }}" > deploy_key
            chmod 600 ./deploy_key
            rsync -chrlvzi --delete \
              -e 'ssh -i ./deploy_key -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no' \
              --exclude '/deploy_key' \
              --exclude '/storage/' \
              --exclude '/vendor/' \
              --exclude '/README.md' \
              --exclude '/./' \
              --exclude '.*' \
              ./ ${{env.dest}}              
      - name: Fix Permissions
        uses: https://github.com/appleboy/ssh-action@master
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USER }}
          port: ${{ secrets.SSH_PORT }}
          key: ${{ secrets.SSH_KEY }}
          script: | 
            cd ${{ secrets.REMOTE_PATH }}
            echo "${{ secrets.SSH_PASS }}" | sudo -S chown -R www-data:www-data ./ 
            echo "${{ secrets.SSH_PASS }}" | sudo -S find ./ -type f -exec chmod 664 {} \;
            echo "${{ secrets.SSH_PASS }}" | sudo -S find ./ -type d -exec chmod 775 {} \;
      - name: Install  Composer and Migrations 
        uses: https://github.com/appleboy/ssh-action@master
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USER }}
          port: ${{ secrets.SSH_PORT }}
          key: ${{ secrets.SSH_KEY }}
          script: "cd ${{ secrets.REMOTE_PATH }} && yes | composer install && yes | php artisan migrate"