Skip to content

Commit e3c1a72

Browse files
committed
feat: add action branding
1 parent b65ddd2 commit e3c1a72

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,36 @@ Start time of synchronization.
4646

4747
End time of synchronization.
4848

49-
## Example usage
49+
## Example usage
50+
51+
links: https://github.com/yeshan333/github-actions-test-repo
52+
53+
```yml
54+
name: rsync-deploy-action tester
55+
56+
on:
57+
push:
58+
branches: [main]
59+
60+
jobs:
61+
hello_world_rsync_deploy:
62+
runs-on: ubuntu-latest
63+
name: A job to test rsync-deploy-action
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@main
67+
- name: Modify files permissions
68+
run: |
69+
chmod 777 -R ./sync_files
70+
ls -l
71+
- name: Tester
72+
uses: yeshan333/rsync-deploy-action@main
73+
id: rsync-deploy-action
74+
with:
75+
ssh_login_username: ${{ secrets.SSH_LOGIN_USERNAME }}
76+
remote_server_ip: ${{ secrets.REMOTE_SERVER_IP }}
77+
ssh_port: ${{ secrets.SSH_PORT }}
78+
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
79+
source_path: ./sync_files/*
80+
destination_path: ~/shan333.cn
81+
```

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ runs:
4343
- ${{ inputs.source_path }}
4444
- ${{ inputs.destination_path }}
4545
- ${{ inputs.ssh_args }}
46-
- ${{ inputs.rsync_args }}
46+
- ${{ inputs.rsync_args }}
47+
48+
branding:
49+
icon: 'file'
50+
color: 'green'

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ echo =========================================================================
2828
start_time=$(date)
2929

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

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

3435
end_time=$(date)
3536

3637
echo "::set-output name=end_time::$end_time"
38+
echo "End time of synchronization -> $end_time"
3739

3840
echo =========================================================================
3941

0 commit comments

Comments
 (0)