Compare commits

..

5 Commits

Author SHA1 Message Date
Dragan Filipovic
5fdc019220 [version] version bump 2019-10-03 00:52:55 +02:00
Dragan Filipovic
177ffc3a2a [version] Readme update 2019-10-03 00:51:32 +02:00
Dragan Filipovic
b5d54bf446 [action] fix node version 2019-10-03 00:24:52 +02:00
Dragan Filipovic
a20c19a8d1 [version] Readme update 2019-10-03 00:17:19 +02:00
Dragan Filipovic
4bf88310d4 [engine] use NodeJS instead of Docker 2019-10-02 23:58:26 +02:00
3 changed files with 49 additions and 34 deletions

View File

@@ -1,6 +1,10 @@
# ssh deployments
This GitHub Action deploys specific directory from `GITHUB_WORKSPACE` to a folder on a server via rsync over ssh.
Deploy code with rsync over ssh, using NodeJS.
NodeJS version is more than a minute `faster` than simple Docker version.
This GitHub Action deploys specific directory from `GITHUB_WORKSPACE` to a folder on a server via rsync over ssh, using NodeJS.
This action would usually follow a build/test action which leaves deployable code in `GITHUB_WORKSPACE`, eg `dist`;
@@ -8,30 +12,45 @@ This action would usually follow a build/test action which leaves deployable cod
Pass configuration with `env` vars
1. `DEPLOY_KEY`
1. `SSH_PRIVATE_KEY` [required]
This should be the 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.
2. `ARGS`
2. `REMOTE_HOST` [required]
eg: mydomain.com
3. `REMOTE_USER` [required]
eg: myusername
2. `ARGS` (optional, default '-rltgoDzvO')
For any initial/required rsync flags, eg: `-avzr --delete`
3. `SOURCE`
The source directory, path relative to `$GITHUB_WORKSPACE` root, eg: `dist`
3. `SOURCE` (optional, default '')
4. `TARGET`
The target directory, in the format`[USER]@[HOST]:[PATH]`
The source directory, path relative to `$GITHUB_WORKSPACE` root, eg: `dist/`
4. `TARGET` (optional, default '/home/REMOTE_USER/')
The target directory
# Usage
```
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@v1.0.0
env:
DEPLOY_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "dist"
TARGET: ${{ secrets.SERVER_STAGING }}
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@v2.0.2
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
```
# Example usage
# Example usage in workflow
```
name: Node CI
@@ -43,29 +62,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: '10.x'
- name: Install npm dependencies
run: |
npm install
run: npm install
- name: Run build task
run: |
npm run build --if-present
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@v1.0.0
env:
DEPLOY_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "dist"
TARGET: ${{ secrets.SERVER_STAGING }}
run: npm run build --if-present
- name: Deploy to Server
uses: easingthemes/ssh-deploy@v2.0.2
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
```
## Disclaimer

View File

@@ -20,7 +20,7 @@ outputs:
status:
description: 'Status'
runs:
using: 'node10'
using: 'node12'
main: 'dist/index.js'
branding:
color: 'green'

View File

@@ -1,6 +1,6 @@
{
"name": "ssh-deploy",
"version": "2.0.0",
"version": "2.0.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": {