Deploy your blog via let.sh
Tags: blog, webdev, deployment, tutorial
Published: 2022-05-12 15:49:34

Hey guys, I'm Bruski, a regular everyday normal engineer🎵 👨🏻‍💻

**Say, do you guys wanna setup a blog site of your own?**


![Image from: http://seoexperts4all.com/makes-blogs-powerful-tool-seo/](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FKjyt-n0N-3.png?alt=media&token=6ba93ca1-a137-4230-83b1-321d5e426c84)


A blog site is a great place for us to record down our notes, daily thoughts or publish professional articles. By writing blogs, we can benefit from reviewing and outputing what we have learned. What's more, thanks to the searching engine like Google, our posts might be searched and visited by anyone in the world, that means someone might get inspired by your articles and your influence on the Internet could eventually scale up.

![Blogging](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FqCY0XuBdEE.png?alt=media&token=c722a327-d65b-474a-8913-91724c90e160)

So back to today's topic, I'm gonna show you how to pick a blog framework and deploy it in seconds via [let.sh](https://let.sh/), the one-command deployment tool.

![Feels good man, says Pepe](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FnmnehSsVkd.png?alt=media&token=be22367a-0527-4a54-a451-2e7318d2ee8b)

> For more infomation about let.sh, please visit [the offical website](https://let.sh/)


**What you are expected to learn:**
- 🚀 deploy your blog site in seconds
- ⛳️ own a website with custom domains and automated HTTPs connections.
- ⚒️ get a powerful console of your blog site for monitoring and benchmark
- 👨🏻‍💻 enjoy a simple yet happy deployment experience


## Step 1: Pick a blog framework

> If you have already setup your blog, just skip to the next chapter ✅

Typically, there are two types of blog framework: `Static-Side Generating` and `Server-Side Rendering`. (check [this post](https://medium.com/codex/web-design-patterns-ssr-ssg-and-spa-fadad7673dfe) for more information). As for tutorial purpose, we choose the type **Static-Side Generating** as our choice. Because this type of framework can generate html files at build time on your local machine, so we can simply transform our posts to a bunch of static files rather than storing them into the database.

There are also many alternatives for selecting Static-Side Generating blog framework such as `Hexo`, `Gatsby`, `Next.js` (more details [here](https://jamstack.org/generators/)). We will pick [Hexo](https://hexo.io/) as our framework because it is a fast, simple & powerful blog framework.

According to [the installation doc of hexo](https://hexo.io/docs/#Installation), we should install its cli firstly:

```
npm install hexo-cli -g
```

And then initialize our blog project with its name `my_blog`:

```
hexo init my_blog
```

If everything goes right, we'll get our project as below:

![code structure](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FMMLKVXTRbI.png?alt=media&token=a860c705-ae8f-4de2-9862-1a3e1cbdbcf1)

We can run the `npm run server` command to preview our blog site locally:

![local preview for the blog site](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FUEp1lndOKV.png?alt=media&token=5fa84b78-a245-489a-849e-83297ad5a2f0)


## Step 2: Install let.sh real quick

Next, install let.sh tool

```
# For MacOS / Linux User
curl -o- -sL https://install.let-sh.com/install.sh | bash

# For Windows User
iwr https://install.let-sh.com/install.ps1 -useb | iex
```

We can verify the installation:

```
lets help
```

![screenshot of the cli - lets help](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FCms5uYsSIU.png?alt=media&token=0e9f4186-b947-47d7-96ff-4ea215ae6f2e)

## Step 3: let's login

Before we use let.sh, we should login our github account in the terminal. Just type in the command and hit enter:

```
lets login
```

Select `Github` login option

![screenshot of the cli - lets login](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FHvFiy-yRd0.png?alt=media&token=95c352c8-658c-45f1-8750-6a61d59b838c)

Authorize let.sh to access the specified permissions to your github account:

![github auth page](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FcMgIh6fc_3.png?alt=media&token=73d23143-95c9-4590-8459-f3e2d1cee0fa)

We'll see the success result page of let.sh if the authorization has been approved.

![login result page](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FQfsek6_c8f.png?alt=media&token=bb91287b-088f-4399-bd92-acc155dcf4c9)

## Step 4: let's deploy

Back to the terminal, now we can finally deploy our blog site to the Internet.

> Note that our terminal is at the root path of our project

No complicated actions, just goes with the command

```
lets deploy
```

Just a few seconds later, the whole deployment has been done elegantly by let.sh.

![screenshot of the cli - lets deploy](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FCqISxzTw5i.png?alt=media&token=d0c8bae3-287c-4ac9-9e5f-feb357a0561a)

Congratulations, now we are free to visit our alive blog site 🎉

[https://my_blog-bruceeewong.let.sh](https://my_blog-bruceeewong.let.sh)

![online blog site](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2F-7-bPYMw9s.png?alt=media&token=12f76dc6-2254-432a-a9c9-5dc0900eab00)

Share it with your fellows right now, shall we? 🍻

## Advanced techniques

As we can see, let.sh automatically detects the type of our framework and triggers the appropriate building action. After building, it uploads all the files to the cloud storage and provides the accessible link that equipped with HTTPs. All these complicated things are done in just one command `lets deploy`.

Meanwhile, **it provides a detail link at the bottom of the output info**. We visit the [https://let.sh/console/projects/my_blog/details](https://let.sh/console/projects/my_blog/details) and it will navigate to the console of our project, where we can check the status of each deployment and the benchmark of our blog pages.

![console panel for the project](https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%2Fapp%2FBruski%2FvkzLQ2PTkJ.png?alt=media&token=a9d10b53-9d6b-462c-a4ba-e65110389fde)

What else, **how about customize the domain name for your blog site instead of the given one?** No problem, just enter the command `lets link <domain_name>` to achieve the goal. We can setup unique subdomain of `.let.sh` immediately, for example:

```
lets link bruce_blog.let.sh
```

If succeeded, we can visit via our custom domain name [https://bruce_blog.let.sh](https://bruce_blog.let.sh) 🎉

> If you want to assign your own domain name, please follow [the instructions](https://docs.let.sh/cli/commands#link)

## What's next

We've finish the deployment of our blog site with let.sh in seconds!

If you have any questions or advanced demands, go visit the documents of let.sh: [https://docs.let.sh/](https://docs.let.sh/)

Happy coding ;)