Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work with GitHub Workflows v2 format #7

Open
wants to merge 4 commits into
base: master
from

Conversation

@oncletom
Copy link

oncletom commented Oct 25, 2019

Sample config:

name: Deploy to production

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: contention/rsync-deployments@master
        with:
          USER_AND_HOST: user@example.com
          DEST: /path/to/target
          SRC: public/
          RSYNC_OPTIONS: -avzr --delete --exclude node_modules --exclude '.git*'
        env:
          DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

It accepts 3 arguments:

  • USER_AND_HOST (mandatory): remote hostname and user (à la user@host.tld)
  • DEST (mandatory): remote host destination path
  • SRC (optional): blank by default (so to say, $GITHUB_WORKSPACE/$SRC) — useful when something has been generated in a subfolder in a previous action (eg: _site/ or public/ with static site generators like Jekyll or Hugo);
  • RSYNC_OPTIONS (optional): additional options to pass to the rsync command;
@contention

This comment has been minimized.

Copy link
Owner

contention commented Oct 25, 2019

Cool - appreciate it.

This has been on my todo list for... well... forever, and I’d actually planned to look at it this weekend, so really good timing. :o)

@oncletom

This comment has been minimized.

Copy link
Author

oncletom commented Oct 26, 2019

Cool!

I did change only the minimum, without rethinking the use of the action with the v2 syntax. GitHub droped the array-like arguments, making it difficult to use $1 & co args.

Feel free to revisit these changes 👍

Thanks for publishing this action in the first place!

@rchrd2

This comment has been minimized.

Copy link

rchrd2 commented Oct 28, 2019

This fork worked for me. The code in the repo did not.

oncletom added 3 commits Dec 23, 2019
@oncletom

This comment has been minimized.

Copy link
Author

oncletom commented Jan 17, 2020

I have updated the PR with an up to date README, reworked arguments and an additional one—to select the subfolder of the Github Action Workspace; I needed this to deploy the output of a Hugo website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.