File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,36 @@ Start time of synchronization.
46
46
47
47
End time of synchronization.
48
48
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
+ ` ` `
Original file line number Diff line number Diff line change 43
43
- ${{ inputs.source_path }}
44
44
- ${{ inputs.destination_path }}
45
45
- ${{ inputs.ssh_args }}
46
- - ${{ inputs.rsync_args }}
46
+ - ${{ inputs.rsync_args }}
47
+
48
+ branding :
49
+ icon : ' file'
50
+ color : ' green'
Original file line number Diff line number Diff line change @@ -28,12 +28,14 @@ echo =========================================================================
28
28
start_time=$( date)
29
29
30
30
echo " ::set-output name=end_time::$start_time "
31
+ echo " Start time of synchronization -> $start_time "
31
32
32
33
rsync -e " $SSH_COMMAND " $8 -av $5 $1 @$2 :$6
33
34
34
35
end_time=$( date)
35
36
36
37
echo " ::set-output name=end_time::$end_time "
38
+ echo " End time of synchronization -> $end_time "
37
39
38
40
echo =========================================================================
39
41
You can’t perform that action at this time.
0 commit comments