├── Dockerfile ├── README.md └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | LABEL "com.github.actions.name"="Github Action for rclone" 4 | LABEL "com.github.actions.description"="Wraps the rclone CLI to be used in Github Actions" 5 | LABEL "com.github.actions.icon"="upload-cloud" 6 | LABEL "com.github.actions.color"="blue" 7 | 8 | LABEL "repository"="http://github.com/wei/rclone" 9 | LABEL "homepage"="http://github.com/wei/rclone" 10 | LABEL "maintainer"="Wei He " 11 | 12 | RUN apk add --no-cache bash curl unzip ca-certificates fuse openssh-client \ 13 | && wget -qO- https://rclone.org/install.sh | bash \ 14 | && apk del bash curl unzip 15 | 16 | ADD *.sh / 17 | 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github Action for rclone 2 | 3 | This Action wraps [rclone](https://rclone.org) to enable syncing files and directories to and from different cloud storage providers. 4 | 5 | 6 | ## Features 7 | * "rsync for cloud storage" 8 | * sync to and from different cloud storage providers 9 | * backup files or deploy artifacts to remote storage 10 | 11 | 12 | ## Usage 13 | 14 | ### Github Actions 15 | ``` 16 | on: push 17 | jobs: 18 | rclone: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@master 22 | - name: rclone 23 | uses: wei/rclone@v1 24 | env: 25 | RCLONE_CONF: ${{ secrets.RCLONE_CONF }} 26 | with: 27 | args: copy : : 28 | ``` 29 | `RCLONE_CONF` can be omitted if [CLI arguments](https://rclone.org/flags/#backend-flags) or [environment variables](https://rclone.org/docs/#environment-variables) are supplied. `RCLONE_CONF` can also be encrypted if [`RCLONE_CONFIG_PASS`](https://rclone.org/docs/#configuration-encryption) secret is supplied. 30 | 31 | ### Docker 32 | ``` 33 | docker run --rm -e "RCLONE_CONF=$(cat ~/.config/rclone/rclone.conf)" $(docker build -q .) \ 34 | copy : : 35 | ``` 36 | 37 | ## Author 38 | [Wei He](https://github.com/wei) _github@weispot.com_ 39 | 40 | 41 | ## License 42 | [MIT](https://wei.mit-license.org) 43 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [[ -n "$RCLONE_CONF" ]] 6 | then 7 | mkdir -p ~/.config/rclone 8 | echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf 9 | fi 10 | 11 | sh -c "rclone $*" 12 | --------------------------------------------------------------------------------