pendect / action-rsyncer Goto Github PK
View Code? Open in Web Editor NEWRsync GitHub Action
License: MIT License
Rsync GitHub Action
License: MIT License
My SSH key uses a passphrase
An environment variable similar to DEPLOY_KEY
that is used for the passphrase
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).
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.
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.
N/A
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 }}"
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!
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 }}'
Full content of the repo got sent to repo
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'
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.
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.
Add any other context or screenshots about the feature request here.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.