This simple action uses the vanilla AWS CLI to sync a directory (either from your repository or generated during your workflow) with a remote DigitalOcean space.
Place in a .yml
file such as this one in your .github/workflows
folder. Refer to the documentation on workflow YAML syntax here.
name: Sync Space
on: push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: idlefingers/do-space-sync-action@master
with:
args: --acl public-read
env:
SOURCE_DIR: './public'
SPACE_NAME: ${{ secrets.SPACE_NAME }}
SPACE_REGION: ${{ secrets.SPACE_REGION}}
SPACE_ACCESS_KEY_ID: ${{ secrets.SPACE_ACCESS_KEY_ID }}
SPACE_SECRET_ACCESS_KEY: ${{ secrets.SPACE_SECRET_ACCESS_KEY }}
Key | Value | Type | Required |
---|---|---|---|
SOURCE_DIR |
The local directory you wish to sync/upload. For example, ./public . |
env |
Yes |
SPACE_REGION |
The region where you created your space in. For example, fra1 . Full list of regions here. |
env |
Yes |
DELETE |
If set to true , deletes any files in the bucket that are not present in the source directory. Default: true . |
env |
No |
The following variables should be added as "secrets" in the action's configuration.
Key | Value | Type | Required |
---|---|---|---|
SPACE_NAME |
The name of the space you're syncing to. For example, jarv.is . |
secret |
Yes |
SPACE_ACCESS_KEY_ID |
Your Spaces Access Key. More info here. | secret |
Yes |
SPACE_SECRET_ACCESS_KEY |
Your Spaces Secret Access Key. More info here. | secret |
Yes |
This project is distributed under the MIT license.
This project is forked from https://github.com/jakejarvis/s3-sync-action with small changes to make the s3 commands work with DigitalOcean.