Skip to content

SSH Push

Actions
Transfer your folders and execute command with SSH used with NodeJS
1.3
Latest
Star (3)

✨ SSH for GitHub Actions

GitHub Action for publish your app via SSH and execute commands.

Actions Status

Variables

See action.yml for more detailed information.

  • HOST - SSH remote host
  • PORT - SSH protocol port, default is 22
  • USERNAME - SSH username
  • PASSWORD - Password of ssh user
  • SOURCE - Folder to be transferred
  • DESTINATION - Destination of source file as archive on remote host
  • SCRIPTS - Execute commands after transfer source file

Usage

on: [push]

jobs:
  deployment_job:
    runs-on: ubuntu-latest
    name: Deployment Job
    steps:
    - uses: actions/checkout@v3

    - name: Set up Node.js
      uses: actions/setup-node@v3
      with:
        node-version: 16

    - name: npm install, build, and test
      run: |
        npm install
        npm run build --if-present

    - name: SSH
        uses: ErenKrt/ssh-push@main
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          source: "./dist"
          destination: "/home/eren/web.zip"
          #scripts: |
          #  rm -r /home/eren/erencandev && mkdir /home/eren/erencandev
          #  cd /home/eren/erencandev && mv /home/eren/web.zip . &&
          #  unzip web.zip && rm -r web.zip
          #  rm -r /home/eren/erencandev/node_modules
          #  sudo -s && cd /home/eren/erencandev/ && npm i
          #  pm2 restart 1

SSH Push is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Transfer your folders and execute command with SSH used with NodeJS
1.3
Latest

SSH Push is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.