denzuko/R2 Asset Sync
Sync Hugo static site assets to Cloudflare R2 via the S3-compatible endpoint. Sets correct Cache-Control headers per asset type, deletes stale objects, and runs a CDN smoke test on completion.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| r2-access-key-id | Cloudflare R2 API token access key ID | yes | — |
| r2-secret-access-key | Cloudflare R2 API token secret access key | yes | — |
| r2-account-id | Cloudflare account ID | yes | — |
| r2-bucket | R2 bucket name (e.g. assets-cdn-example-com) | yes | — |
| build-dir | Path to Hugo build output directory | no | hugo/public |
| cdn-domain | Custom CDN domain for smoke test (e.g. assets.cdn.example.com). If omitted the smoke test is skipped. | no | "" |
| asset-dirs | Space-separated list of asset subdirectories to sync with immutable Cache-Control. Defaults cover standard Hugo output. | no | css js fonts images og |
| favicon-patterns | Space-separated glob patterns for root-level assets synced with 24-hour Cache-Control (not content-hashed). | no | favicon* apple-touch* site.webmanifest |
Outputs
| name | description |
|---|---|
| endpoint | The R2 S3-compatible endpoint URL used for the sync |
| objects-synced | Number of objects uploaded or updated |