Github Action providing simple scp feature
- name: Copy single file
uses: dj-256/github-deploy@v1
with:
local: main.py
remote: /home/user/example
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Copy entire directory
uses: dj-256/github-deploy@v1
with:
local: ./dist
remote: /var/www/app
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
- name: Excluding JS files
uses: dj-256/github-deploy@v1
with:
local: dist
remote: /home/example/
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
exclude: '*.js'
- name: Copy exluding subdirectory
uses: dj-256/github-deploy@v1
with:
local: ./
remote: /var/www/dir
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.SSH_PORT }}
exclude: 'out'
-
local - string - Path to the local file or directory you want to copy, relative to repository root. required
-
remote - string - Path to the remote directory to copy the contents to, absolute. required
-
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)
-
passphrase - string - For an encrypted private key, this is the passphrase used to decrypt it. Default: (none)
-
rmRemote - boolean - Clean directory before uploading. Default:
false
-
exclude - string - Paths excluded from the copy, relative to remote path. You can specify a single file or directory or else, use a glob.
This has been strongly inspired by garygrossgarten's github-action-scp it uses node-scp and glob