google-github-actions / upload-cloud-storage

A GitHub Action for uploading files to a Google Cloud Storage (GCS) bucket.
https://cloud.google.com/storage
Apache License 2.0
206 stars 49 forks source link

Cache based on Checksum #299

Closed andreas-fahrecker closed 1 year ago

andreas-fahrecker commented 1 year ago

TL;DR

Upload files only when the checksum is different from the repo file to the CloudStorage file.

Detailed design

If a file already exists in the CloudStorage Bucket with the same name as a file to be uploaded by the Action, then the file should be downloaded first. Then the checksums of the files with identical names should be compared. And finally the file defined to be uploaded to the CloudStorage Bucket should only be uploaded when the checksum has changed.

Additional information

No response

sethvargo commented 1 year ago

Hi @andreas-fahrecker

What is the use case for this? It sounds like you might want to use gsutil rsync instead: https://cloud.google.com/storage/docs/gsutil/commands/rsync

andreas-fahrecker commented 1 year ago

Thanks for the fast response @sethvargo

Seems like that would do the job, is there a Github Action for that?

sethvargo commented 1 year ago

You can use setup-gcloud to install gsutil and then just run the gsutil command.