Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update your surge.sh project?

Tags:

surge.sh

I deployed a surge.sh project and it was published successfully, however, I want to make some updates to the project, the updates have been applied locally and can be seen working but it tried to publish it to the same domain again yet it doesn't appear updated. I also tried to tear down the project and re-upload it still it shows the old project, I cleared the cache too but it still didn't update. Any idea why?

like image 378
UWGOOSE Avatar asked Mar 12 '18 19:03

UWGOOSE


2 Answers

Use the following deploy script to update your deployed Surge Project

"deploy": "surge --project ./path_to_build_folder --domain custom-domain.surge.sh"
like image 20
Akshay Vijay Jain Avatar answered Sep 26 '22 13:09

Akshay Vijay Jain


To update a project you just need to publish it again to the same domain.

You can do this quickly by creating a file called CNAME in the project root directory to set the default domain name, like this:

echo site-name.surge.sh >CNAME

Then each time to update:

surge .

Alternatively, without a CNAME file, specify the domain in the surge command like this:

surge --domain site-name.surge.sh .

See https://surge.sh/help/remembering-a-domain .

This will not solve the need to tear down and republish the site described in the original post, but if you're not having that problem, it will make it quick to update your surge.sh project, as per the title question, without the need to edit the domain the usual prompt.

like image 127
phhu Avatar answered Sep 25 '22 13:09

phhu