Github Actions: Distinguish multiple deployments from one repo
Answered
Lenz Weber-Tronic posted this in #help-forum
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?
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 Lenz Weber-Tronic
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'5 Replies
Asian black bear
Probably best to ask over at the Vercel community at https://vercel.community/
I had hoped to avoid signing up for another community, but it seems unavoidable - thanks 🙂
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.
Thanks! 🙂
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