Add example
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
		
							parent
							
								
									5e4c286287
								
							
						
					
					
						commit
						a79592f0da
					
				
							
								
								
									
										18
									
								
								.github/main.workflow
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								.github/main.workflow
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
workflow "Copy File Via SSH" {
 | 
			
		||||
  on = "push"
 | 
			
		||||
  resolves = [
 | 
			
		||||
    "Executing remote ssh commands",
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
action "Executing remote ssh commands" {
 | 
			
		||||
  uses = "appleboy/ssh-action@master"
 | 
			
		||||
  secrets = [
 | 
			
		||||
    "HOST",
 | 
			
		||||
    "USERNAME",
 | 
			
		||||
    "PASSWORD",
 | 
			
		||||
  ]
 | 
			
		||||
  args = [
 | 
			
		||||
    "--script", "whoami",
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										34
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								README.md
									
									
									
									
									
								
							@ -1,3 +1,33 @@
 | 
			
		||||
# ssh-action
 | 
			
		||||
# 🚀 SSH for GitHub Actions
 | 
			
		||||
 | 
			
		||||
GitHub Action for executing remote ssh commands.
 | 
			
		||||
[GitHub Action](https://developer.github.com/actions/) for executing remote ssh commands.
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
copy files and artifacts via SSH as blow.
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
action "Copy multiple file" {
 | 
			
		||||
  uses = "appleboy/scp-action@master"
 | 
			
		||||
  env = {
 | 
			
		||||
    HOST = "example.com"
 | 
			
		||||
    USERNAME = "foo"
 | 
			
		||||
    PASSWORD = "bar"
 | 
			
		||||
    PORT = "22"
 | 
			
		||||
    SOURCE = "tests/a.txt,tests/b.txt"
 | 
			
		||||
    TARGET = "/home/foo/test"
 | 
			
		||||
  }
 | 
			
		||||
  secrets = [
 | 
			
		||||
    "PASSWORD",
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Environment variables
 | 
			
		||||
 | 
			
		||||
* HOST - ssh server host
 | 
			
		||||
* PORT - ssh server port
 | 
			
		||||
* USERNAME - ssh server username
 | 
			
		||||
* PASSWORD - ssh server password
 | 
			
		||||
* KEY - ssh server private key
 | 
			
		||||
* SCRIPT - execute the scripts
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user