In this guide, you will learn how to deploy your Gridsome site to Surge.
Surge is a cloud platform for hosting static websites, which is extremely simple to use but offers customization options for those who need them.
Their generous free tier permits unlimited publishing, using custom domains, and basic SSL, with more features available through the professional plan.
This guide will show you how to get started in a few quick steps:
To install the surge CLI with npm
, paste the following into your terminal:
npm install -g surge
To install the surge CLI with yarn
, paste the following into your terminal:
yarn global add surge
Build a site by running this command in your project's root directory:
gridsome build
This generates a publishable version of your site in the ./dist
folder.
You can deploy your site by running the following in the root of the project directory.
surge dist/
Done 🙂
Note: If this is your first time using Surge, you'll be prompted to create a (free) account from the command line. This will only happen once.
gridsome build
first.