Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garygrossgarten/github-action-scp
⬆️ Copy a folder to a remote server using SSH
https://github.com/garygrossgarten/github-action-scp
actions copy github-actions scp ssh
Last synced: 7 days ago
JSON representation
⬆️ Copy a folder to a remote server using SSH
- Host: GitHub
- URL: https://github.com/garygrossgarten/github-action-scp
- Owner: garygrossgarten
- License: mit
- Created: 2019-09-04T01:06:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T17:21:39.000Z (6 months ago)
- Last Synced: 2024-10-29T23:59:27.400Z (2 months ago)
- Topics: actions, copy, github-actions, scp, ssh
- Language: JavaScript
- Homepage:
- Size: 10.4 MB
- Stars: 191
- Watchers: 3
- Forks: 53
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - garygrossgarten/github-action-scp - ⬆️ Copy a folder to a remote server using SSH (JavaScript)
README
# GitHub Action SCP
Simple GitHub Action to copy a folder or single file to a remote server using SSH. This is working with the latest [GitHub Actions](https://github.com/features/actions).
## ✨ Example Usage
**Copy a folder recursively to a remote server**
```yml
- name: Copy folder content recursively to remote
uses: garygrossgarten/github-action-scp@release
with:
local: test
remote: scp/directory
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}```
**Copy a single file to a remote server**
```yml
- name: Copy single file to remote
uses: garygrossgarten/github-action-scp@release
with:
local: test/oof.txt
remote: scp/single/oof.txt
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}```
🔐 Set your secrets here: `https://github.com/USERNAME/REPO/settings/secrets`.
Check out [the workflow example](.github/workflows/scp-example-workflow.yml) for a minimalistic yaml workflow in GitHub Actions.
**Result**
![result of example ssh workflow](result.png)
## Options
- **local** - _string_ - Path to local folder you want to copy. **required**
- **remote** - _string_ - Path to folder to copy the contents to. **required**
- **concurrency** - _number_ - Number of concurrent file transfers. **Default:** `1`
- **recursive** - _boolean_ - Copy directory contents recursively. **Default:** `true`
- **verbose** - _boolean_ - Output every single file transfer status. **Default:** `true`
- **host** - _string_ - Hostname or IP address of the server. **Default:** `'localhost'`
- **port** - _integer_ - Port number of the server. **Default:** `22`
- **username** - _string_ - Username for authentication. **Default:** (none)
- **password** - _string_ - Password for password-based user authentication. **Default:** (none)
- **dotfiles** - _boolean_ - Include files with a leading `.` e.g. `.htaccess` **Default:** `false`
- **privateKey** - _mixed_ - _Buffer_ or _string_ that contains a private key for either key-based or hostbased user authentication (OpenSSH format). **Default:** (none)
- **passphrase** - _string_ - For an encrypted private key, this is the passphrase used to decrypt it. **Default:** (none)
- **tryKeyboard** - _boolean_ - Try keyboard-interactive user authentication if primary user authentication method fails. **Default:** `false`
- **atomicPut** - _boolean_ - Upload files to temporary file first, then rename once upload completed. **Default:** `false`
- **rmRemote** - _boolean_ - Clean directory before uploading. **Default:** `false`## Development
---
This thing is build using Typescript and
[ssh2](https://github.com/mscdex/ssh2) (via [node-ssh](https://github.com/steelbrain/node-ssh)). 🚀