Giter Site home page Giter Site logo

github-action-scp's Introduction

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.

✨ Example Usage

Copy a folder recursively to a remote server

- 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

- 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 for a minimalistic yaml workflow in GitHub Actions.

Result

result of example ssh workflow

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 (via node-ssh). 🚀

github-action-scp's People

Contributors

bernhardbehrendt avatar garygrossgarten avatar virtuald avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.