I do a lot of web development and all of my static files (css, js, images) are hosted on AWS S3. Whenever I push out a change, I would like to take all of my changed static files and upload them to s3 automatically (so I don't have to do this manually).
The other issue is that if I upload them as the same name then I might run into caching issues e.g. user has old version of one JS file but new CSS, which could cause conflicts.
If the first is possible, is it also possible to change the names on those files and update the code with the new name? Obviously I would like this change to remain only on the servers while the code on my laptop wouldn't be renamed.
Look into git hooks - this will let you run a script after every push, so you can automate tasks exactly like you describe.
To avoid the caching issue is tricky, although I believe S3 uses Etags which should mitigate the problem somewhat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With