Skip to content

GitHub Action to upload and download files/directories between local and remote servers in workflows.

License

Notifications You must be signed in to change notification settings

alpacax/alpacon-cp-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alpacon CP Action

Copy files and directories between your local machine and a remote server in your Alpacon workspace using the alpacon cp command in GitHub Actions.

Official Docs: alpacon cp

Features

  • Upload files or folders to a remote server
  • Download files or folders from a remote server
  • Supports recursive copy, user/group options, and multiple files

Important notes

  • Download target-path: Must be a directory path (e.g., ./, ./data/). The file will be saved with its original filename.
  • Upload target-path: Can be either a specific file path or directory path.
  • Recursive operations: Use recursive: true for directory operations.

Prerequisites

This action requires the Alpacon CLI to be installed in your workflow. Use the Alpacon Setup Action first:

- name: Setup Alpacon CLI
  uses: alpacax/[email protected]

Usage examples

Upload a file to a remote server

- name: Upload File
  uses: alpacax/[email protected]
  with:
    workspace-url: ${{ secrets.ALPACON_WORKSPACE_URL }}
    api-token: ${{ secrets.ALPACON_API_TOKEN }}
    source: './data/file.txt'
    target-server: 'worker1'
    target-path: '/data/file.txt'
    username: ubuntu

Download a file from a remote server

- name: Download File
  uses: alpacax/[email protected]
  with:
    workspace-url: ${{ secrets.ALPACON_WORKSPACE_URL }}
    api-token: ${{ secrets.ALPACON_API_TOKEN }}
    source: '/data/file.txt'
    target-server: 'worker1'
    target-path: './data/'  # Directory path - file will be saved as './data/file.txt'
    mode: download
    username: ubuntu

Upload a directory recursively

- name: Upload Directory
  uses: alpacax/[email protected]
  with:
    workspace-url: ${{ secrets.ALPACON_WORKSPACE_URL }}
    api-token: ${{ secrets.ALPACON_API_TOKEN }}
    source: './data/'
    target-server: 'worker1'
    target-path: '/data/'
    recursive: true
    username: ubuntu

Download a directory recursively

- name: Download Directory
  uses: alpacax/[email protected]
  with:
    workspace-url: ${{ secrets.ALPACON_WORKSPACE_URL }}
    api-token: ${{ secrets.ALPACON_API_TOKEN }}
    source: '/data/'
    target-server: 'worker1'
    target-path: './data/'
    mode: download
    recursive: true
    username: ubuntu

Inputs

Name Description Required
workspace-url Alpacon workspace URL. Yes
api-token Alpacon API token for authentication. Yes
source Path to upload (local) or download (remote). Yes
target-server Target server name. Yes
target-path Destination path (remote for upload, local for download). Yes
mode "upload" (default) or "download". No
recursive Set to true to copy directories recursively. No
username Username for server authentication (optional). No
groupname Group name for server authentication (optional). No

Notes

  • For upload: source is a local path, target-path is the remote destination
  • For download: source is a remote path, target-path is the local destination
  • To copy multiple files, provide an array to source
  • See the alpacon cp documentation for advanced usage

About

GitHub Action to upload and download files/directories between local and remote servers in workflows.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •