Skip to content

Conversation

@rchlfryn
Copy link
Collaborator

@rchlfryn rchlfryn commented Jan 13, 2026

Description

Since we ran out of space, we need to properly clean up Vercel preview items. This includes two main aread:

  • Environment variables

    • This script works great! Added a branch catch all just in case (will need to remove for main)
    • We need to remove 4 variables associated with each branch:
      • DATABASE_URI
      • DATABASE_AUTH_TOKEN
      • PAYLOAD_SEED_PASSWORD
      • NEXT_PUBLIC_ROOT_DOMAIN
  • Deployments and aliases

    • We need to remove the alias first since it is associated with a deployment id
    • Each branch/PR has 2 aliases that switch to the most recently deployed deployment
      • Wild card alias: BRANCH_NAME.preview.avy-fx.org
      • ID alias: avy-HASH-nwac.vercel.app

TODO:

  • Clean up deployments for main from github-merge-queue[bot]
  • Clean up deployments for release

@github-actions
Copy link

Preview deployment: https://gha-cleanup.preview.avy-fx.org

@rchlfryn rchlfryn marked this pull request as ready for review January 14, 2026 18:23
@rchlfryn rchlfryn requested a review from busbyk January 14, 2026 18:35
@rchlfryn rchlfryn self-assigned this Jan 14, 2026
Copy link
Collaborator

@busbyk busbyk left a 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" \
Copy link
Collaborator

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.

Copy link
Collaborator Author

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    age

Copy link
Contributor

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.

Copy link
Collaborator Author

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..

Copy link
Contributor

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

@rchlfryn rchlfryn Jan 14, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants