-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |