Use Cyberduck CLI GitHub Action
Use Cyberduck CLI in a GitHub Actions workflow conveniently in a docker container.
Usage in Custom Workflow
- Add the - [cyberduck-cli-action](https://github.com/iterate-ch/cyberduck-cli-action)action to a workflow- .ymlwith 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: 'release/*' args: '--verbose'
- Choose a - mode. Several modes are supported like- download,- listand- uploadprobably the most common usage. If you want to any of the supported command line parameters use- rawand omit the- pathand- urloptions.
- Set the - urlinput option to a valid URI that references the protocol, optional server and destination upload file or directory as documented. For S3 this would be- s3:/<bucket>/<key>or for SFTP- sftp://<server>/<directory>/.- Attention - Make sure to include a trailing - /in- urlinput to denote a directory.
- Specify credentials in the environment with - USERNAME,- PASSWORD. Additionally- IDENTITYcan be used for SFTP connections equivalent to the- --identityparameter. The example assumes you have- S3_ACCESS_KEYand- S3_SECRET_KEYdefined as a secret. Alternatively specify- --username ${{secrets.USER}} --password ${{secrets.PASSWORD}}in- args.
- Add additional arguments for Cyberduck CLI. Any of the available generic options can be passed with the - argsinput.- Tip - Only overwrite existing files on changes using - args: '--existing compare'.
- Read output in a next step using the key - logusing- jobs.<job_id>.outputs.logoutput.
References
- Cyberduck CLI GitHub Action README