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?
Use the following deploy script to update your deployed Surge Project
"deploy": "surge --project ./path_to_build_folder --domain custom-domain.surge.sh"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With