-
Notifications
You must be signed in to change notification settings - Fork 29
feat: upload whole public dir to files.cow.fi #1274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
WalkthroughTwo GitHub Actions workflows were changed: Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Update as "Update Permit Info" workflow
participant Deploy as "s3Deploy" workflow
participant S3 as Amazon S3 (s3://files.cow.fi/token-lists)
participant CF as CloudFront Distribution
Note over Update,Deploy: Existing workflow runs
Update->>GH: completes
GH->>Deploy: workflow_run trigger (on completed)
Deploy->>S3: aws s3 sync src/public -> s3://files.cow.fi/token-lists
Deploy->>S3: (existing) upload tokens to /tokens
Deploy->>CF: create invalidation for /tokens/* and /token-lists/*
CF-->>Deploy: invalidation acknowledged
Deploy-->>GH: job completed
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alfetopito
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with one nitpick comment.
Will ask devops to take a look as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment this won't work as that bucket is private. Ideally we'd create a separate, public, bucket, just to keep everything fully separate.
Ignore this comment as I forgot we have cloudfront in front of it 🤦
| - name: Upload to S3 | ||
| run: | | ||
| aws s3 cp src/public/CowSwap.json s3://files.cow.fi/tokens/CowSwap.json | ||
| aws s3 sync src/public s3://files.cow.fi/token-lists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After testing to make sure it works as expected, if files need to be removed, then the --delete flag could be set. Should probably do a dry-run first.
naanselmo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work, CloudFront appears to be configured to make all files in the bucket public without any limitations
|
Merged and manually triggered a run to try it out https://github.com/cowprotocol/token-lists/actions/runs/19769577954 |
|
cc @naanselmo |
|
Fixed permissions and reran! Worked now! |

This PR is part of https://linear.app/cowswap/issue/COW-136/token-lists-cdn
Moving away from our reliance on github CDN.
Testing
Simplest way to test is to merge, trigger the s3 upload workflow and see if the lists are available on https://files.cow.fi/token-lists
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.