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

Documentation for GitHub Action #595

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cli/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Command Line Interface (CLI)
====

:::{toctree}

Check warning on line 4 in cli/index.md

View workflow job for this annotation

GitHub Actions / build

toctree contains reference to nonexisting document 'cli/docker'
:hidden:
:titlesonly:
docker
support
:::

Expand Down Expand Up @@ -151,6 +152,16 @@
::::
:::::

### Docker Image

_Cyberduck CLI_ is available as a Docker Image. Install from the command line with

docker pull ghcr.io/iterate-ch/cyberduck:latest

### GitHub Action

_[Cyberduck CLI GitHub Action](https://github.com/iterate-ch/cyberduck-cli-action)_ is available for [GitHub Actions](https://github.com/features/actions). It runs Cyberduck CLI within a docker container. Refer to [Use Cyberduck CLI GitHub Action](../tutorials/cli_github_action.md).

## Usage

`Usage:duck [options...]`
Expand Down Expand Up @@ -408,6 +419,14 @@
duck --move protocol:/<folder>/<name> <file>
```

### Copy files using `--copy`

You can copy files using the `--copy` command. Use an absolute path for the target filename. Server-side [copy support](../cyberduck/copy.md#copy-files-and-folders-between-servers) is limited to some protocols.

```{code-block}
duck --copy protocol:/<folder>/<name> <file>
```

### Cryptomator

Access to your [Cryptomator](../cryptomator/index.md) Vaults from the command line. When accessing a vault using
Expand Down
46 changes: 46 additions & 0 deletions tutorials/cli_github_action.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Use Cyberduck CLI GitHub Action
===

> The universal file transfer tool `duck` runs in your shell on Linux and OS X or your Windows command line prompt
> for GitHub Actions conveniently in a docker container.


## Usage

You add the `cyberduck-cli-action` action to a [GitHub Action](https://docs.github.com/en/actions) workflow with a step like

- name: Upload
uses: iterate-ch/cyberduck-cli-action@v1
env:
USERNAME: ${{secrets.S3_ACCESS_KEY}}
PASSWORD: ${{secrets.S3_SECRET_KEY}}
with:
mode: upload
url: 's3:/bucket/path/'
path: 'target/Release/*'
args: '--verbose'

Several modes are supported like `download`, `list` and `upload` probably the most common usage. For `upload` the
`url` input option requires must be a valid URI that references the protocol, optional server and destination upload file or directory as [documented](https://docs.duck.sh/cli/#uri). For [S3](https://docs.duck.sh/protocols/s3/) this would be `s3://<hostname>/<bucket>/<key>` or for [SFTP](https://docs.duck.sh/protocols/sftp/) `sftp://<server>/<directory>/

The example assumes you have `S3_ACCESS_KEY` and `S3_SECRET_KEY` defined as a [secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).

:::{tip}
Make sure to include a trailing `/` in `url` input to denote a directory.
:::

Any of the available [generic options](https://docs.duck.sh/cli/#generic-options) can be passed with the `args` input.

Another usage would be to work with a list of files retrieved from a S3 bucket available and reference
using the key `log` using `jobs.<job_id>.outputs.log` [output](https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id).

- id: list
uses: iterate-ch/cyberduck-cli-action@v1
with:
mode: list
url: 's3:/profiles.cyberduck.io/'
- run: echo "${{ steps.list.outputs.log }}"

## References

* Cyberduck CLI GitHub Action [README](https://github.com/iterate-ch/cyberduck-cli-action/blob/main/README.md)
6 changes: 5 additions & 1 deletion tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ custom_oauth_client_id
iam
vault_localdisk
sftp_publickeyauth
cli_github_action
:::

Find detailed step-by-step instructions for setup, connecting and most common use-cases as well as tutorials for more complicated workarounds.
Expand All @@ -26,4 +27,7 @@ IAM allows you to create credentials for third parties accessing your S3 account
Both [Cyberduck](../cyberduck/index.md) and [Mountain Duck](../mountainduck/index.md) support accessing vaults on your local disk.

## [Configure Public Key Authentication for SFTP](sftp_publickeyauth.md)
Configure Public Key Authentication for SFTP using OpenSSH tools.
Configure Public Key Authentication for SFTP using OpenSSH tools.

## [Use Cyberduck CLI GitHub Action](cli_github_action.md)
Use Cyberduck CLI Docker Container in GitHub Actions
Loading