ft-interactive / starter-kit

A template for IG pages
64 stars 15 forks source link

Deploy pages to private buckets #325

Closed pandringa closed 5 months ago

pandringa commented 7 months ago

This PR modifies our starter-kit publishing strategy to upload files to our new private S3 buckets. To make this work, I had to make a few adjustments:

The new approach with private buckets has CircleCI build every branch to our new Okta-protected preview bucket, served at:

https://ig.in.ft.com/preview/ft-interactive/[repo]/[branch]/

Separately, CircleCI will build tagged versions only to the live bucket, which appear at URLs like:

https://djd-ig-live.s3.amazonaws.com/v3/ft-interactive/[repo]/HEAD/

This URL won't be accessible itself, but you can paste it directly into IG Router to generate a public link.

CircleCI will also upload files to the URL with your tag instead of HEAD, so you can quickly roll back changes by updating the IG Router to point to /v1.0.0/ (or whatever your latest known-safe version was). Eventually, we'll hope to have a feature to make this even easier by letting you choose the version from a dropdown within IG Router.

pandringa commented 5 months ago

Thanks for your feedback, @emmalewis and @aendra-rininsland! Some quick thoughts:

emmalewis commented 5 months ago

@pandringa Sounds good, thanks

pandringa commented 5 months ago

Apologies for my force-pushes above... I had to test out the new commit hook functionality!

I've set up a post-push hook (which technically doesn't exist in git but I found a clean way to replicate it) which prints out details of the CircleCI job, preview link, and live link (if you've pushed a tag) by calling g-deploy --get-commit-url.

See a screenshot here:

Screenshot 2024-03-18 at 20 38 42

I'd welcome any suggestions if either of you have formatting or content ideas!