Skip to content

digital-clouds/rclone-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rclone Github Action

Run rclone to sync files and directories from different cloud storage providers.

Usage

---
name: "🔄 Rclone"

on:
  push:
    branches: [main]
    # Paths which will tigger workflow
    #paths:
    #  - "static/**"
  workflow_dispatch: {}

jobs:
  sync:
    #if: github.repository == 'org-or-user/repository-name'
    runs-on: ubuntu-latest
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true
    env:
      # Source path (some/path/to/source)
      local_path: ""
      # Remote path (remote:some/remote/path
      remote_path: ""
    steps:
      - name: "⤵️ Check out code from GitHub"
        uses: actions/checkout@v3
      - name: "⏫ Run rclone"
        id: run-rclone
        uses: digital-clouds/rclone-action@v1.0.0
        with:
          # The RCLONE_CONFIG secret must be set to set up for rclone (required)
          config: ${{ secrets.RCLONE_CONFIG }}
          # Pass any argumets supported by rclone (required)
          args: "sync ${{ env.local_path }} ${{ env.remote_path }}"
          # Verbose debugging and logging or carry on, but do quit on errors (optional)
          debug: false

        # Optional: Output of the rclone
      - name: "⏬ Output rclone"
        run: echo "The time was ${{ steps.run-rclone.outputs.rclone }}"
  • config can be omitted if CLI arguments or environment variables are supplied.
  • args pass any argumets supported by rclone.
  • config-file set custom location for rclone configuration file.
  • self-update if true will force update rclone to the latest version.
  • debug verbose debugging and logging or carry on, but do quit on errors.