Skip to content

Commit

Permalink
feat: add action branding
Browse files Browse the repository at this point in the history
  • Loading branch information
yeshan333 committed Jan 15, 2021
1 parent b65ddd2 commit e3c1a72
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,36 @@ Start time of synchronization.

End time of synchronization.

## Example usage
## Example usage

links: https://github.com/yeshan333/github-actions-test-repo

```yml
name: rsync-deploy-action tester

on:
push:
branches: [main]

jobs:
hello_world_rsync_deploy:
runs-on: ubuntu-latest
name: A job to test rsync-deploy-action
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Modify files permissions
run: |
chmod 777 -R ./sync_files
ls -l
- name: Tester
uses: yeshan333/rsync-deploy-action@main
id: rsync-deploy-action
with:
ssh_login_username: ${{ secrets.SSH_LOGIN_USERNAME }}
remote_server_ip: ${{ secrets.REMOTE_SERVER_IP }}
ssh_port: ${{ secrets.SSH_PORT }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
source_path: ./sync_files/*
destination_path: ~/shan333.cn
```
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ runs:
- ${{ inputs.source_path }}
- ${{ inputs.destination_path }}
- ${{ inputs.ssh_args }}
- ${{ inputs.rsync_args }}
- ${{ inputs.rsync_args }}

branding:
icon: 'file'
color: 'green'
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ echo =========================================================================
start_time=$(date)

echo "::set-output name=end_time::$start_time"
echo "Start time of synchronization -> $start_time"

rsync -e "$SSH_COMMAND" $8 -av $5 $1@$2:$6

end_time=$(date)

echo "::set-output name=end_time::$end_time"
echo "End time of synchronization -> $end_time"

echo =========================================================================

Expand Down

0 comments on commit e3c1a72

Please sign in to comment.