-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
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 }}"Metadata
Metadata
Assignees
Labels
No labels