Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Jan 8, 2025
1 parent e7874f6 commit 2f7828a
Showing 1 changed file with 46 additions and 0 deletions.
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)

0 comments on commit 2f7828a

Please sign in to comment.