-
Notifications
You must be signed in to change notification settings - Fork 1
Add vercel cleanup to GHA #856
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
base: main
Are you sure you want to change the base?
Conversation
|
Preview deployment: https://gha-cleanup.preview.avy-fx.org |
busbyk
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.
TODO:
Clean up deployments for main from github-merge-queue[bot]
Clean up deployments for release
I'm for deleting all old deployments. We could restore the old deployments manually like you mentioned.
| echo "Cleaning up deployments and aliases for branch: $BRANCH_NAME" | ||
| # Get all deployments for the project | ||
| DEPLOYMENTS=$(curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \ |
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.
Can we not do this with the CLI? Not that there's necessarily anything wrong with using the REST API but the CLI feels a little bit more readable and it would be consistent with the rest of the workflows.
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.
As I mentioned below, I think the CLI is limited in what it allows.
➜ web git:(gha-cleanup) vercel alias ls
Vercel CLI 48.12.0
> aliases found under nwac [832ms]
source url ageThere 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.
(unsolicited review, feel free to ignore)
This is pretty much the point at which point writing this in a real programming language that has error handling, etc, is well worth the effort - Claude is pretty good to transpose logic. Python, Node, whatever.
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.
@stevekuznetsov happy to have another reviewer!
This is pretty much the point at which point writing this in a real programming language that has error handling, etc, is well worth the effort - Claude is pretty good to transpose logic. Python, Node, whatever.
I am a bit confused on the ask, so say more..
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.
The logic is currently written as a shell script. I'd personally prefer to see a Node script, or a Python script, etc, that can implement the logic to interop with the APIs and manage the data, etc
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
|
||
| - name: Remove Vercel Deployments and Aliases | ||
| - name: Remove Vercel deployments and aliases |
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.
I'm actually having a hard time determining what changed with this job. What's the major change here besides using the REST API instead of the CLI?
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.
That's really it - I was having a hard time with the CLI. It seems like the CLI is more for action (deploy, install, etc) and the API allows for better query and search which is what we need.
I also think the branch name was set incorrectly
Description
Since we ran out of space, we need to properly clean up Vercel preview items. This includes two main aread:
Environment variables
main)DATABASE_URIDATABASE_AUTH_TOKENPAYLOAD_SEED_PASSWORDNEXT_PUBLIC_ROOT_DOMAINDeployments and aliases
BRANCH_NAME.preview.avy-fx.orgavy-HASH-nwac.vercel.appTODO:
mainfromgithub-merge-queue[bot]release