Next.js Discord

Discord Forum

Github Actions: Distinguish multiple deployments from one repo

Answered
Nile Crocodile posted this in #help-forum
Open in Discord
Avatar
Nile CrocodileOP
I have more than one "project" set up for a monorepo, and now I'm struggling how to distinguish between those in a post-deployment GH action.
So far I followed https://vercel.com/guides/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment, but that just runs for every deployment of every project, while I want it to focus in on just one.
How to distinguish between deployments here?
Answered by Nile Crocodile
Figured it out:
-if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
+if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview – apollo__experimental-nextjs-app-support'
View full answer

5 Replies

Avatar
Asian black bear
Probably best to ask over at the Vercel community at https://vercel.community/
Avatar
Nile CrocodileOP
I had hoped to avoid signing up for another community, but it seems unavoidable - thanks 🙂
Avatar
Asian black bear
It's connected to your Vercel account if I recall correctly. In any case, community engineers over there are likely to be more helpful in terms of Vercel as a platform. Best of luck.
Avatar
Nile CrocodileOP
Thanks! 🙂
Avatar
Nile CrocodileOP
Figured it out:
-if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
+if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview – apollo__experimental-nextjs-app-support'
Answer