{"id":14985926,"url":"https://github.com/michaelliao/sync-s3-compatible-action","last_synced_at":"2025-07-03T05:03:53.112Z","repository":{"id":254044383,"uuid":"845293467","full_name":"michaelliao/sync-s3-compatible-action","owner":"michaelliao","description":"The sync-s3-compatible-action is a GitHub action which can sync a directory to an S3-compatible storage.","archived":false,"fork":false,"pushed_at":"2025-06-14T13:12:45.000Z","size":289,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T13:39:28.189Z","etag":null,"topics":["action","aliyun","aws","baidu","bos","bucket","cloud-storage","cloudflare","cos","oss","qcloud","r2","s3","sync"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelliao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-21T01:06:01.000Z","updated_at":"2025-06-14T13:12:15.000Z","dependencies_parsed_at":"2024-08-25T08:48:11.029Z","dependency_job_id":"ea629a0d-c198-4544-92a9-eafa3bb0071c","html_url":"https://github.com/michaelliao/sync-s3-compatible-action","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"5e480b0570e8523b582415f1876e533639321537"},"previous_names":["michaelliao/sync-s3like-action"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/michaelliao/sync-s3-compatible-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelliao%2Fsync-s3-compatible-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelliao%2Fsync-s3-compatible-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelliao%2Fsync-s3-compatible-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelliao%2Fsync-s3-compatible-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelliao","download_url":"https://codeload.github.com/michaelliao/sync-s3-compatible-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelliao%2Fsync-s3-compatible-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263264642,"owners_count":23439247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","aliyun","aws","baidu","bos","bucket","cloud-storage","cloudflare","cos","oss","qcloud","r2","s3","sync"],"created_at":"2024-09-24T14:11:57.781Z","updated_at":"2025-07-03T05:03:53.104Z","avatar_url":"https://github.com/michaelliao.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync S3-Compatible Action\n\nThe `sync-s3-compatible-action` is a GitHub Action designed to synchronize files from a local directory to various S3-compatible cloud storage services. Works with:\n\n- AWS S3\n- CloudFlare R2\n- Aliyun OSS\n- QCloud COS\n- Baidu Cloud BOS\n\nThe action performs intelligent synchronization by comparing the local directory with the remote storage and only uploading new or modified files.\n\n## Environment Variables\n\nThe `sync-s3-compatible-action` takes the following environment variables as inputs:\n\n| Name               | Default | Required | Description                                                                      |\n|--------------------|---------|----------|----------------------------------------------------------------------------------|\n| SYNC_DIR           | `_site` | No       | Source directory to synchronize.                                                 |\n| SYNC_TYPE          | `aws`   | No       | Cloud storage provider type: `aws`, `cloudflare`, `aliyun`, `qcloud`, `baidu`.   |\n| SYNC_BUCKET        |         | Yes      | Storage bucket name.                                                             |\n| SYNC_REGION        |         | Yes      | Region name or identifier.                                                       |\n| SYNC_ACCESS_ID     |         | Yes      | API access ID.                                                                   |\n| SYNC_ACCESS_SECRET |         | Yes      | API aceess secret.                                                               |\n| SYNC_OPT_UNUSED    | `keep`  | No       | How to handle files on cloud storage that don't exist locally: `keep`, `delete`. |\n\n## Notes\n\n- `SYNC_ACCESS_ID` and `SYNC_ACCESS_SECRET` are confidential and should NOT be written in GitHub action yaml. Add these values as [encrypted secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) and pass the secrets as env inputs.\n- Files which exist on cloud storage but not exist in local directory will be **keeped** by default. To remove unused files you must set `SYNC_OPT_UNUSED` to `delete` explicitly.\n- Default value of `SYNC_DIR` is `_site`, which is specifically chosen to make it seamless to sync GitHub Pages content to cloud storage providers.\n\n## Example\n\nAn example of GitHub Action shows how to generate GitHub pages and sync `_site` to AWS S3:\n\n```yaml\n# build-and-sync.yml\nname: Build static site and sync to cloud storage.\n\non:\n  push:\n    branches: [$default-branch]\n  workflow_dispatch:\n\npermissions:\n  contents: read\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Setup Ruby\n        uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0\n        with:\n          ruby-version: '3.1'\n          bundler-cache: true\n          cache-version: 0\n      - name: Build with Jekyll\n        # Outputs to the './_site' directory by default\n        run: bundle exec jekyll build --baseurl \"${{ steps.pages.outputs.base_path }}\"\n        env:\n          JEKYLL_ENV: production\n      - name: Sync to Cloud Storage\n        uses: michaelliao/sync-s3-compatible-action@v5\n        env:\n          # force delete unused files on cloud storage:\n          SYNC_OPT_UNUSED: delete\n          # \"_site\" is default value\n          SYNC_DIR: _site\n          SYNC_TYPE: aws\n          # bucket must be exist in region:\n          SYNC_REGION: us-west-1\n          SYNC_BUCKET: gh-s3-sync-action-example\n          # set at: Settings - Secrets and variables - Actions - Repository secrets:\n          SYNC_ACCESS_ID: ${{ secrets.SYNC_ACCESS_ID }}\n          SYNC_ACCESS_SECRET: ${{ secrets.SYNC_ACCESS_SECRET }}\n```\n\n## Configurations\n\n### AWS\n\nAWS regions can be found on [this page](https://docs.aws.amazon.com/general/latest/gr/s3.html):\n\n![AWS](aws.png)\n\n### CloudFlare\n\nThe region of CloudFlare R2 must be set to your account id which can be found on R2 page:\n\n![CloudFlare](cloudflare.png)\n\n### Aliyun\n\nAliyun regions can be found on [this page](https://help.aliyun.com/document_detail/40654.html):\n\n![Aliyun](aliyun.png)\n\n### QCloud\n\nThe region of QCloud bucket can be found in bucket list page:\n\n![QCloud](qcloud.png)\n\n### Baidu Cloud\n\nBaidu cloud regions can be found on [this page](https://cloud.baidu.com/doc/BOS/s/akrqd2wcx):\n\n![Baidu Cloud](baidu.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelliao%2Fsync-s3-compatible-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelliao%2Fsync-s3-compatible-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelliao%2Fsync-s3-compatible-action/lists"}