Compare commits

..

18 Commits

Author SHA1 Message Date
Dragan Filipovic
191986574c [DOCS] Readme update 2020-09-18 23:35:33 +02:00
Dragan Filipovic
d41b136666 [BUILD] rebuild 2020-09-18 23:31:43 +02:00
Dragan Filipovic
1ac1bcb558 [VERSION] version bump 2020-09-18 23:31:31 +02:00
Dragan Filipovic
c14eb85faf [DOCS] Readme update 2020-09-18 23:29:28 +02:00
Dragan Filipovic
2bc5e10d4d [Formatting] formatting updates 2020-09-18 23:26:31 +02:00
Dragan Filipović
4f928a3efc Merge pull request #15 from easingthemes/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-08-16 22:52:37 +02:00
dependabot[bot]
aac4cbf0db Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 08:46:30 +00:00
Dragan Filipovic
4042d3876f [build] update package lock 2020-07-01 01:01:48 +02:00
Dragan Filipovic
68f9da66f0 [version] prepare rc.1 2020-07-01 00:56:10 +02:00
Dragan Filipovic
073bd0b6f6 [build] rebuild 2020-07-01 00:54:42 +02:00
Dragan Filipovic
14eb503e62 [action] get input vars from ENV or WITH workflow settings 2020-07-01 00:54:24 +02:00
Dragan Filipovic
a9e37f3cb5 [version] increase version 2020-07-01 00:20:13 +02:00
Dragan Filipović
ff615959b6 Merge pull request #11 from aperezdc/master
action.yml: Add mising declaration for the ARGS parameter
2020-07-01 00:17:59 +02:00
Adrian Perez de Castro
5c4b90e3f8 action.yml: Add mising declaration for the ARGS parameter 2020-06-30 23:03:20 +03:00
Dragan Filipović
66b3ffb0f7 Merge pull request #10 from easingthemes/9-Readme-update-ssh-keys
#9 Add link to more info about SSH keys
2020-06-29 21:10:59 +02:00
Dragan Filipovic
037d157977 #9 Add link to more info about SSH keys 2020-06-29 21:09:04 +02:00
Dragan Filipović
e34308df6c Merge pull request #6 from perlun/patch-1
README.md: fix typo
2020-06-15 22:03:58 +02:00
Per Lundberg
ad838db71f README.md: fix typo 2020-06-06 23:36:28 +03:00
8 changed files with 61 additions and 24 deletions

View File

@@ -12,46 +12,50 @@ This action would usually follow a build/test action which leaves deployable cod
Pass configuration with `env` vars
1. `SSH_PRIVATE_KEY` [required]
##### 1. `SSH_PRIVATE_KEY` [required]
This should be the private key part of an ssh key pair.
Private key part of an SSH key pair.
The public key part should be added to the `authorized_keys` file on the server that receives the deployment.
The keys should be generated using the PEM format. You can us this command
More info for SSH keys: https://www.ssh.com/ssh/public-key-authentication
The keys should be generated using the PEM format. You can use this command
```
ssh-keygen -m PEM -t rsa -b 4096
```
2. `REMOTE_HOST` [required]
##### 2. `REMOTE_HOST` [required]
eg: mydomain.com
3. `REMOTE_USER` [required]
##### 3. `REMOTE_USER` [required]
eg: myusername
3. `REMOTE_PORT` (optional, default '22')
##### 4. `REMOTE_PORT` (optional, default '22')
eg: '59184'
2. `ARGS` (optional, default '-rltgoDzvO')
##### 5. `ARGS` (optional, default '-rltgoDzvO')
For any initial/required rsync flags, eg: `-avzr --delete`
3. `SOURCE` (optional, default '')
##### 6. `SOURCE` (optional, default '')
The source directory, path relative to `$GITHUB_WORKSPACE` root, eg: `dist/`
4. `TARGET` (optional, default '/home/REMOTE_USER/')
##### 7. `TARGET` (optional, default '/home/REMOTE_USER/')
The target directory
# Usage
!!! Please use latest version, Readme file is just an example, eg: ssh-deploy@v2.1.5
```
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@v2.0.7
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO"
@@ -84,7 +88,7 @@ jobs:
- name: Run build task
run: npm run build --if-present
- name: Deploy to Server
uses: easingthemes/ssh-deploy@v2.1.1
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"

View File

@@ -23,6 +23,10 @@ inputs:
description: "Target directory"
required: false
default: "/home/REMOTE_USER/"
ARGS:
description: "Arguments to pass to rsync"
required: false
default: "-rltgoDzvO"
outputs:
status:
description: "Status"

26
dist/index.js vendored
View File

@@ -551,6 +551,24 @@ module.exports = {
module.exports = require("path");
/***/ }),
/***/ 659:
/***/ (function(module) {
const inputNames = ['REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT', 'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME', 'SOURCE', 'TARGET', 'ARGS'];
const inputs = {
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE
};
// Get inputs from ENV or WITH workflow settings
inputNames.forEach((input) => {
inputs[input] = process.env[input] || process.env[`INPUT_${input}`];
});
module.exports = inputs;
/***/ }),
/***/ 669:
@@ -573,7 +591,7 @@ const {
REMOTE_PORT, SSH_PRIVATE_KEY, DEPLOY_KEY_NAME,
SOURCE, TARGET, ARGS,
GITHUB_WORKSPACE
} = process.env;
} = __webpack_require__(659);
const defaultOptions = {
ssh: true,
@@ -626,7 +644,7 @@ const run = () => {
validateInputs({ SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER });
sshDeploy.init({
src: `${GITHUB_WORKSPACE}/${SOURCE}` || '',
src: `${GITHUB_WORKSPACE}/${SOURCE || ''}`,
dest: TARGET || `/home/${REMOTE_USER}/`,
args: ARGS ? [ARGS] : ['-rltgoDzvO'],
host: REMOTE_HOST,
@@ -689,7 +707,7 @@ const validateInputs = (inputs) => {
});
if (validInputs.length !== inputKeys.length) {
console.error(`⚠️ [INPUTS] Inputs not valid, aborting ...`);
console.error('⚠️ [INPUTS] Inputs not valid, aborting ...');
process.abort();
}
};
@@ -697,7 +715,7 @@ const validateInputs = (inputs) => {
module.exports = {
validateRsync,
validateInputs
}
};
/***/ }),

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "ssh-deploy",
"version": "2.1.0",
"version": "2.1.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -995,9 +995,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"mimic-fn": {

View File

@@ -1,6 +1,6 @@
{
"name": "ssh-deploy",
"version": "2.1.0",
"version": "2.1.5",
"description": "This GitHub Action deploys specific directory from `GITHUB_WORKSPACE` to a folder on a server via rsync over ssh.",
"main": "src/index.js",
"dependencies": {

View File

@@ -9,7 +9,7 @@ const {
REMOTE_PORT, SSH_PRIVATE_KEY, DEPLOY_KEY_NAME,
SOURCE, TARGET, ARGS,
GITHUB_WORKSPACE
} = process.env;
} = require('./inputs');
const defaultOptions = {
ssh: true,
@@ -62,7 +62,7 @@ const run = () => {
validateInputs({ SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER });
sshDeploy.init({
src: `${GITHUB_WORKSPACE}/${SOURCE}` || '',
src: `${GITHUB_WORKSPACE}/${SOURCE || ''}`,
dest: TARGET || `/home/${REMOTE_USER}/`,
args: ARGS ? [ARGS] : ['-rltgoDzvO'],
host: REMOTE_HOST,

11
src/inputs.js Normal file
View File

@@ -0,0 +1,11 @@
const inputNames = ['REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT', 'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME', 'SOURCE', 'TARGET', 'ARGS'];
const inputs = {
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE
};
// Get inputs from ENV or WITH workflow settings
inputNames.forEach((input) => {
inputs[input] = process.env[input] || process.env[`INPUT_${input}`];
});
module.exports = inputs;

View File

@@ -35,7 +35,7 @@ const validateInputs = (inputs) => {
});
if (validInputs.length !== inputKeys.length) {
console.error(`⚠️ [INPUTS] Inputs not valid, aborting ...`);
console.error('⚠️ [INPUTS] Inputs not valid, aborting ...');
process.abort();
}
};
@@ -43,4 +43,4 @@ const validateInputs = (inputs) => {
module.exports = {
validateRsync,
validateInputs
}
};