{"id":13412487,"url":"https://github.com/jakejarvis/s3-sync-action","last_synced_at":"2025-09-26T17:30:41.307Z","repository":{"id":37550097,"uuid":"203791942","full_name":"jakejarvis/s3-sync-action","owner":"jakejarvis","description":"🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺","archived":false,"fork":false,"pushed_at":"2024-03-28T08:32:42.000Z","size":41,"stargazers_count":1048,"open_issues_count":59,"forks_count":483,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-11T12:55:07.305Z","etag":null,"topics":["actions","aws","aws-s3","ci","deployment","github-actions","s3"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/s3-sync","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakejarvis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-08-22T12:36:43.000Z","updated_at":"2025-01-03T09:29:07.000Z","dependencies_parsed_at":"2023-01-04T15:04:09.922Z","dependency_job_id":"6f747d95-bd06-43b3-8c38-0d8cb6853633","html_url":"https://github.com/jakejarvis/s3-sync-action","commit_stats":{"total_commits":37,"total_committers":5,"mean_commits":7.4,"dds":0.4054054054054054,"last_synced_commit":"7ed8b112447abb09f1da74f3466e4194fc7a6311"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakejarvis%2Fs3-sync-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakejarvis%2Fs3-sync-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakejarvis%2Fs3-sync-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakejarvis%2Fs3-sync-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakejarvis","download_url":"https://codeload.github.com/jakejarvis/s3-sync-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234325231,"owners_count":18814394,"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":["actions","aws","aws-s3","ci","deployment","github-actions","s3"],"created_at":"2024-07-30T20:01:25.219Z","updated_at":"2025-09-26T17:30:36.072Z","avatar_url":"https://github.com/jakejarvis.png","language":"Shell","funding_links":[],"categories":["Shell","Community Resources","五、按场景分类的实用Action"],"sub_categories":["Deployment","5. 部署发布"],"readme":"# GitHub Action to Sync S3 Bucket 🔄\n\nThis simple action uses the [vanilla AWS CLI](https://docs.aws.amazon.com/cli/index.html) to sync a directory (either from your repository or generated during your workflow) with a remote S3 bucket.\n\n\n## Usage\n\n### `workflow.yml` Example\n\nPlace in a `.yml` file such as this one in your `.github/workflows` folder. [Refer to the documentation on workflow YAML syntax here.](https://help.github.com/en/articles/workflow-syntax-for-github-actions)\n\nAs of v0.3.0, all [`aws s3 sync` flags](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) are optional to allow for maximum customizability (that's a word, I promise) and must be provided by you via `args:`.\n\n#### The following example includes optimal defaults for a public static website:\n\n- `--acl public-read` makes your files publicly readable (make sure your [bucket settings are also set to public](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html)).\n- `--follow-symlinks` won't hurt and fixes some weird symbolic link problems that may come up.\n- Most importantly, `--delete` **permanently deletes** files in the S3 bucket that are **not** present in the latest version of your repository/build.\n- **Optional tip:** If you're uploading the root of your repository, adding `--exclude '.git/*'` prevents your `.git` folder from syncing, which would expose your source code history if your project is closed-source. (To exclude more than one pattern, you must have one `--exclude` flag per exclusion. The single quotes are also important!)\n\n```yaml\nname: Upload Website\n\non:\n  push:\n    branches:\n    - master\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@master\n    - uses: jakejarvis/s3-sync-action@master\n      with:\n        args: --acl public-read --follow-symlinks --delete\n      env:\n        AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}\n        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n        AWS_REGION: 'us-west-1'   # optional: defaults to us-east-1\n        SOURCE_DIR: 'public'      # optional: defaults to entire repository\n```\n\n\n### Configuration\n\nThe following settings must be passed as environment variables as shown in the example. Sensitive information, especially `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, should be [set as encrypted secrets](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) — otherwise, they'll be public to anyone browsing your repository's source code and CI logs.\n\n| Key | Value | Suggested Type | Required | Default |\n| ------------- | ------------- | ------------- | ------------- | ------------- |\n| `AWS_ACCESS_KEY_ID` | Your AWS Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret env` | **Yes** | N/A |\n| `AWS_SECRET_ACCESS_KEY` | Your AWS Secret Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret env` | **Yes** | N/A |\n| `AWS_S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is` or `my-app-releases`. | `secret env` | **Yes** | N/A |\n| `AWS_REGION` | The region where you created your bucket. Set to `us-east-1` by default. [Full list of regions here.](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) | `env` | No | `us-east-1` |\n| `AWS_S3_ENDPOINT` | The endpoint URL of the bucket you're syncing to. Can be used for [VPC scenarios](https://aws.amazon.com/blogs/aws/new-vpc-endpoint-for-amazon-s3/) or for non-AWS services using the S3 API, like [DigitalOcean Spaces](https://www.digitalocean.com/community/tools/adapting-an-existing-aws-s3-application-to-digitalocean-spaces). | `env` | No | Automatic (`s3.amazonaws.com` or AWS's region-specific equivalent) |\n| `SOURCE_DIR` | The local directory (or file) you wish to sync/upload to S3. For example, `public`. Defaults to your entire repository. | `env` | No | `./` (root of cloned repository) |\n| `DEST_DIR` | The directory inside of the S3 bucket you wish to sync/upload to. For example, `my_project/assets`. Defaults to the root of the bucket. | `env` | No | `/` (root of bucket) |\n\n\n## License\n\nThis project is distributed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakejarvis%2Fs3-sync-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakejarvis%2Fs3-sync-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakejarvis%2Fs3-sync-action/lists"}