Skip to content

Commit

Permalink
Add option to change args of rsync when uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
violine1101 authored Sep 4, 2024
1 parent bb20572 commit 1afcd16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ All options without a default are required.

- **artifact_destination** - _string_ - Target folder for artifact upload.

- **rsync_args** - _string_ - Arguments for uploading artifacts via rsync. **Default:** `-avhW --delete`

- **script** - _string_ - Script to run after uploading of artifacts. **Default:** (empty)
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ inputs:
artifact_destination:
description: "Target folder for artifact upload."
required: true
rsync_args:
description: "Arguments for uploading artifacts via rsync."
required: false
default: -avhW --delete
script:
description: "Script to run after uploading of artifacts."
required: false
Expand Down Expand Up @@ -81,7 +85,7 @@ runs:
echo Uploading artifacts...
while IFS= read -r ARTIFACT_PATH; do
echo Uploading artifact $ARTIFACT_PATH...
rsync -avh --delete -e "ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -p $BASTION_PORT" $GITHUB_WORKSPACE/$ARTIFACT_PATH $USERNAME@$BASTION_IP:$ARTIFACT_DESTINATION
rsync $RSYNC_ARGS -e "ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -p $BASTION_PORT" $GITHUB_WORKSPACE/$ARTIFACT_PATH $USERNAME@$BASTION_IP:$ARTIFACT_DESTINATION
done < <(printf '%s' "$ARTIFACT_PATHS")
shell: bash
env:
Expand All @@ -90,6 +94,7 @@ runs:
USERNAME: ${{ inputs.username }}
ARTIFACT_PATHS: ${{ inputs.artifact_paths }}
ARTIFACT_DESTINATION: ${{ inputs.artifact_destination }}
RSYNC_ARGS: ${{ inputs.rsync_args }}
- name: Run deploy script
run: |
echo Running internal deploy script...
Expand Down

0 comments on commit 1afcd16

Please sign in to comment.