Merge pull request #96 from easingthemes/feature/default-rsync-options
feat: update default rsync options
This commit is contained in:
		
						commit
						7c9b40539e
					
				
							
								
								
									
										2
									
								
								.github/workflows/e2e-manual.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/e2e-manual.yml
									
									
									
									
										vendored
									
									
								
							@ -6,7 +6,7 @@ on:
 | 
			
		||||
      ARGS:
 | 
			
		||||
        description: 'ARGS'
 | 
			
		||||
        required: true
 | 
			
		||||
        default: '-rltgoDzvO --delete --chmod=ugo+rwX --progress'
 | 
			
		||||
        default: '-rlgoDzvc -i --delete --chmod=ugo+rwX --progress'
 | 
			
		||||
      EXCLUDE:
 | 
			
		||||
        description: 'EXCLUDE'
 | 
			
		||||
        required: true
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							@ -74,7 +74,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
      - name: set shared ENV variables for multi target deployment
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "ARGS=-rltgoDzvOR --delete --chmod=ugo+rwX --progress" >> $GITHUB_ENV
 | 
			
		||||
          echo "ARGS=-rlgoDzvcR -i --delete --chmod=ugo+rwX --progress" >> $GITHUB_ENV
 | 
			
		||||
          echo "SSH_CMD_ARGS=-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null" >> $GITHUB_ENV
 | 
			
		||||
          echo "SOURCE=test_project/ test_project2/" >> $GITHUB_ENV
 | 
			
		||||
          echo "EXCLUDE=skip_dir/, /node_modules/" >> $GITHUB_ENV
 | 
			
		||||
 | 
			
		||||
@ -41,7 +41,7 @@ eg: myusername
 | 
			
		||||
 | 
			
		||||
eg: '59184'
 | 
			
		||||
 | 
			
		||||
##### 5. `ARGS` (optional, default '-rltgoDzvO')
 | 
			
		||||
##### 5. `ARGS` (optional, default '-rlgoDzvc -i')
 | 
			
		||||
 | 
			
		||||
For any initial/required rsync flags, eg: `-avzr --delete`
 | 
			
		||||
 | 
			
		||||
@ -62,6 +62,8 @@ path to exclude separated by `,`, ie: `/dist/, /node_modules/`
 | 
			
		||||
 | 
			
		||||
Script to run on host machine before rsync. Single line or multiline commands.
 | 
			
		||||
Execution is preformed by storing commands in `.sh` file and executing it via `.bash` over `ssh`
 | 
			
		||||
If you have issues with `ssh` connection, use this var, eg `SCRIPT_BEFORE: ls`.
 | 
			
		||||
This will force `known_hosts` update, adding your host via `ssh-keyscan`.
 | 
			
		||||
 | 
			
		||||
##### 10. `SCRIPT_AFTER` (optional, default '')
 | 
			
		||||
 | 
			
		||||
@ -83,7 +85,7 @@ or use the latest version from a branch, eg: ssh-deploy@main
 | 
			
		||||
    uses: easingthemes/ssh-deploy@main
 | 
			
		||||
    env:
 | 
			
		||||
      SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
 | 
			
		||||
      ARGS: "-rltgoDzvO"
 | 
			
		||||
      ARGS: "-rlgoDzvc -i"
 | 
			
		||||
      SOURCE: "dist/"
 | 
			
		||||
      REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
 | 
			
		||||
      REMOTE_USER: ${{ secrets.REMOTE_USER }}
 | 
			
		||||
@ -124,7 +126,7 @@ jobs:
 | 
			
		||||
      uses: easingthemes/ssh-deploy@main
 | 
			
		||||
      env:
 | 
			
		||||
          SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
 | 
			
		||||
          ARGS: "-rltgoDzvO --delete"
 | 
			
		||||
          ARGS: "-rlgoDzvc -i --delete"
 | 
			
		||||
          SOURCE: "dist/"
 | 
			
		||||
          REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
 | 
			
		||||
          REMOTE_USER: ${{ secrets.REMOTE_USER }}
 | 
			
		||||
@ -156,6 +158,7 @@ For complex use cases, use `ARGS` and `SSH_CMD_ARGS` to fully configure `rsync`
 | 
			
		||||
- If you need to use multiple steps, eg multi targets deployment, save shared ENV variables in `>> $GITHUB_ENV`.
 | 
			
		||||
Check .github/workflows/e2e.yml for an example
 | 
			
		||||
- For multi sources, use -R ARG to manipulate folders structure.
 | 
			
		||||
- Great post about `rsync` options specific to usage of this action: https://logansnotes.com/2020/gh-action-site-deploy/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Disclaimer
 | 
			
		||||
 | 
			
		||||
@ -26,7 +26,7 @@ inputs:
 | 
			
		||||
  ARGS:
 | 
			
		||||
    description: "Arguments to pass to rsync"
 | 
			
		||||
    required: false
 | 
			
		||||
    default: "-rltgoDzvO"
 | 
			
		||||
    default: "-rlgoDzvc -i"
 | 
			
		||||
  SSH_CMD_ARGS:
 | 
			
		||||
    description: "An array of ssh arguments, they must be prefixed with -o and separated by a comma, for example: -o SomeArgument=no, -o SomeOtherArgument=5 "
 | 
			
		||||
    required: false
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -13,7 +13,7 @@ const defaultInputs = {
 | 
			
		||||
  source: './',
 | 
			
		||||
  target: `/home/${remoteUser}/`,
 | 
			
		||||
  exclude: '',
 | 
			
		||||
  args: '-rltgoDzvO',
 | 
			
		||||
  args: '-rlgoDzvc -i',
 | 
			
		||||
  sshCmdArgs: '-o StrictHostKeyChecking=no',
 | 
			
		||||
  deployKeyName: `deploy_key_${remoteUser}_${Date.now()}`
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user