meilisearch / demos

A list of Meilisearch demos with open-source code and live preview ⚡️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid redeploying all demos every time a change is made in the src directory

CaroFG opened this issue · comments

@nicolasvienot I've been told you are the Vercel expert 😄 do you know if this is possible? I have not found a way of doing it in the Vercel settings

Hey @CaroFG 😃
Just to be sure I understood your issue, what you want is that when there is a change on main on this repository, Vercel only redeploys the projects where there were actual changes (src/project_xxx) and not all the projects, am I right?

Exactly!

You can find more information about monorepos and Vercel here.

As @shivaylamba pointed out, you should use the Ignored Build Step in order to manage this. What you can do is add an Ignored Build Step for each project that will only allow the deployment if there is a diff between the previously deployed version and the new one in git.

For example, in a simple version and for the project MoMa, you could add an Ignored Build Step like this:

git diff HEAD^ HEAD --quiet ./src/MoMa

You can add it directly in Vercel in Settings/Git for each project, or create a script in each folder and then just execute the script in the Ignored Build Step.

Let me know if you need any help!

Thank you @nicolasvienot!

According to this article
Capture d’écran 2022-05-31 à 11 06 05

If the root directory is set to 'src/MoMA', like so:
Capture d’écran 2022-05-31 à 11 17 52

the command should be the following:
git diff HEAD^ HEAD --quiet .

Is that right?

According to this article Capture d’écran 2022-05-31 à 11 06 05

If the root directory is set to 'src/MoMA', like so: Capture d’écran 2022-05-31 à 11 17 52

the command should be the following: git diff HEAD^ HEAD --quiet .

Is that right?

Yes, totally. My bad I didn't see the comment about the Root directory.
That's nice because you can use the same command for all demos projects and even write it in the Maintainer guidelines 😄

I added the command to all demos, I just merged a PR modifying the demos README and nothing was redeployed, so I'd say it works 😄 Closing this then. Haven't tested making a change in the src/ folder so feel free to reopen the issue if the problem persists