If you are using Github actions for deployment then you should checkout this
https://github.com/marketplace/actions/git-restore-mtime
This action step restores the timestamp very well and post that S3 sync will only upload the last updated file and not the entire directory