Giter VIP home page Giter VIP logo

github-actions-rsync's Introduction

Rsync Deployments

Rsync files from a GitHub repo to a destination server over SSH

Environment variables

Variable Description
SSH_PRIVATE_KEY The private key part of an SSH key pair. The public key part should be added to the authorized_keys on the destination server.
SSH_USERNAME The username to use when connecting to the destination server
SSH_HOSTNAME The hostname of the destination server

Required arguments

Argument Description
RSYNC_OPTIONS Rsync-specific options when running the command. Exclusions, deletions, etc
RSYNC_TARGET Where to deploy the files on the server
RSYNC_SOURCE What files to deploy from the repo (starts at root) NOTE: a trailing / deploys the contents of the directory instead of the entire directory

Example usage

name: Create Sandbox

on: pull_request

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v1

      - name: Deploy to sandbox via rsync
        uses: trendyminds/github-actions-rsync@master
        with:
          RSYNC_OPTIONS: -avzr --delete --exclude node_modules --exclude '.git*'
          RSYNC_TARGET: /path/to/target/folder/on/server
          RSYNC_SOURCE: /src/public/
        env:
          SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
          SSH_USERNAME: ${{secrets.SSH_USERNAME}}
          SSH_HOSTNAME: ${{secrets.SSH_HOSTNAME}}

Disclaimer

Check your keys. Check your deployment paths. And use at your own risk!

github-actions-rsync's People

Contributors

aaronbushnell avatar contention avatar frankfoerster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.