Skip to content

Commit

Permalink
Feature release
Browse files Browse the repository at this point in the history
- Ability to exclude files from delta sync
  • Loading branch information
milanmk committed Jun 24, 2022
1 parent 9a3de87 commit 58030c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This is a composite GitHub Action (Linux runner) for deploying repository conten

```yml
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Deploy"
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 30
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Deploy"
Expand Down Expand Up @@ -93,6 +93,7 @@ jobs:
| local-path | yes | . | Local path to repository |
| remote-path | yes | . | Remote path on host |
| sync | yes | delta | File synchronization (delta, full) |
| sync-delta-excludes | no | | Files to exclude from delta sync |
| ssh-options | no | | Additional arguments for SSH client |
| ftp-options | no | | Additional arguments for FTP client |
| ftp-mirror-options | no | | Additional arguments for mirroring |
Expand All @@ -113,10 +114,9 @@ jobs:
- `full`: Transfer all files (upload)
- Does not delete files on remote host
- Default glob exclude pattern is `.git*/`
- `sync-delta-excludes` accepts [pathspec](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) patterns to exclude files from delta sync.
- For `ftp-options` and `ftp-mirror-options` command arguments please refer to [LFTP manual](https://lftp.yar.ru/lftp-man.html)
- `ftp-post-sync-commands` can be used to run additional LFTP commands after the
synchronization. For example, to upload a file watched by a process manager
on the server in order to restart a deamon:
- `ftp-post-sync-commands` can be used to run additional LFTP commands after the synchronization. For example, to upload a file watched by a process manager on the server in order to restart a deamon:
```
ftp-post-sync-commands: |
!touch watched_file
Expand Down
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ inputs:
description: "File synchronization (delta, full)"
required: true
default: "delta"
sync-delta-excludes:
description: "Files to exclude from delta sync"
required: false
ssh-options:
description: "Additional command arguments for SSH client"
required: false
Expand Down Expand Up @@ -313,8 +316,8 @@ runs:
# show_hr
if git cat-file -t ${git_previous_commit} &>/dev/null; then
git diff --name-only --diff-filter=ACMRT ${git_previous_commit}..${{github.sha}} ':!/.git*' > ~/files_to_upload && echo "File created: ~/files_to_upload" && cat ~/files_to_upload && show_hr
git diff-tree --diff-filter=D --name-only -t ${git_previous_commit}..${{github.sha}} ':!/.git*' > ~/files_to_delete && echo "File created: ~/files_to_delete" && cat ~/files_to_delete && show_hr
git diff --name-only --diff-filter=ACMRT ${git_previous_commit}..${{github.sha}} ':!/.git*' ${{inputs.sync-delta-excludes}} > ~/files_to_upload && echo "File created: ~/files_to_upload" && cat ~/files_to_upload && show_hr
git diff-tree --diff-filter=D --name-only -t ${git_previous_commit}..${{github.sha}} ':!/.git*' ${{inputs.sync-delta-excludes}} > ~/files_to_delete && echo "File created: ~/files_to_delete" && cat ~/files_to_delete && show_hr
if [ "${{inputs.artifacts}}" == "true" ]; then
echo "Copy transfer artifacts" && mkdir ~/transfer_files && rsync --verbose --files-from=$HOME/files_to_upload . ~/transfer_files/
Expand Down

0 comments on commit 58030c1

Please sign in to comment.