Giter Site home page Giter Site logo

action-rsyncer's People

Contributors

ericof avatar jay-oswald avatar steffenbew avatar taupecat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-rsyncer's Issues

Add support for passphrase keys

Is your feature request related to a problem? Please describe ⚡️

My SSH key uses a passphrase

Describe the solution you'd like ✨

An environment variable similar to DEPLOY_KEY that is used for the passphrase

Question: Is it possible to have rsync create the remote directories if they don't exist?

First, thanks for this great action, it works great!

I was wondering if it is possible somehow to create the remote directories if they aren't there?

e.g. I am copying my local build directory to remote directory /data/foo/bar/20200115 but foo, bar and 20200115 may or may not exist.

I tried the -R flag for rsync and tried mkdir --parents /tmp/foo/bar/20200115 as a flag for ssh (the latter works for me locally).

Provide a list of files to the `src`

Is your feature request related to a problem? Please describe ⚡️

I would like to do an automatic rsync but only to the files changes on my last commit.
AFAIK, rsync supports this but I am not sure if the action does.

Describe the solution you'd like ✨

Using bash/git, I can get a list of changed files and would like to use them as my input src making sure only those files are rsync-ed.

Describe alternatives you've considered 🎡

N/A

Additional context 🖼

An example would be something like this:

jobs:
  changed-files:
    name: Changed files
    runs-on: ubuntu-latest
    # Map a step output to a job output
    outputs:
      all: ${{ steps.changes.outputs.all}}
    steps:
        # Make sure we have some code to diff.
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Get changed files
        id: changes
        # Set outputs using the command.
        run: |
          echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)"

  deploy:
    - name: Deploy to server
      id: deploy
      uses: Pendect/[email protected]
      env:
        DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
      with:
        flags: '-avzr --delete'
        options: ''
        ssh_options: ''
        src: '${{needs.changed-files.outputs.all}}'
        dest: '[email protected]:/var/www/server.com'

    - name: Display status from deploy
      run: echo "${{ steps.deploy.outputs.status }}"

This thing sends an empty folder!

Describe the bug 🔍

I try to make the action that uploads an entire content of repository (with excluding of hidden files), however, this thing NEVER finds me files in /github/workspace where it should be a repo!

To Reproduce 💥

name: Auto-Upload

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to server
        id: deploy
        uses: Pendect/[email protected]
        env:
          DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
        with: 
          flags: '-avzr --delete --exclude=".*"'
# attempted WORKAROUND, primarly I used just "*" to upload everything
          options: '../workspace'
          ssh_options: '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
          src: '.'
          dest: '${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.EDITOR_HELP_REMOTE }}'

Expected behavior ✨

Full content of the repo got sent to repo

Screenshots 📸

A blank folder:
Снимок экрана_2020-02-19_23-04-37

Example how to limit upload time if host is unavailable / not writable

Is your feature request related to a problem? Please describe ⚡️

We recently had the problem that one of our servers had wrong writing permissions.

https://github.com/seqan/seqan3/actions/runs/102633544

https://github.com/seqan/seqan3/runs/667513448?check_suite_focus=true#step:9:16

The build was killed after 6h by ci. Normally a CI-Job takes around 15 minutes that means that we wasted 24x the normal time of one job when a failure occurred.

Config:

      - name: Deploy User Documentation
        uses: Pendect/action-rsyncer@master
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_HOST_SSH_KEY }}
          REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
          REMOTE_USER: ${{ secrets.REMOTE_USER }}
          TARGET: ${{ secrets.REMOTE_TARGET }}
        with:
          flags: '-avzr --delete'
          src: 'doc-build/doc_usr/html/'
          dest: '$REMOTE_USER@$REMOTE_HOST:$TARGET/3-master-user'

Describe the solution you'd like ✨

I would want that the upload fails earlier if I encounter some network or server issues. Since most people just copy-paste examples, I would suggest that this use-case should be included and how to avoid this.

Describe alternatives you've considered 🎡

Nothing yet, I also haven't looked into what flags for rsync should be used to limit upload retries to 1 and a time limit of 10s if unreachable / unwriteable.

Additional context 🖼

Add any other context or screenshots about the feature request here.

What Format of Key is required?

When trying to use rsync I get the error
Error loading key "/github/home/.ssh/deploy_key": invalid format
What format of public key is required?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.