Tailwind Logo

Netlify - Adding a new site

Related Technology

Published: 2021-07-16

In this section, we will introduce the actual procedure for registering a site. We will proceed on the assumption that the data for hosting has already been registered in the GitHub repository.

Add a site

Click on the New site from Git button in the upper right corner of the administration page. The procedure for adding a site will begin.

netlify03.png

You will be prompted to specify the Git provider for the site you are creating.

netlify04.png

The code itself on this site is all available in the form of https://github.com/haramizu/haramizu.com. So, we will select the GitHub repository for this project.

netlify05.png

Since my account is already logged in with my GitHub account, the list of repositories I have is displayed. You can also see that private repositories are displayed in the list. In terms of the operation of the site, since the code does not need to be published separately, it would be fine to link it to the private repositories.

In this case, we specified the haramizu.com repository.

netlify06.png

You can then specify which branch to use to publish the site. Here, of course, we specify main.

Basic build settings will vary depending on the tool you are using. In this case, since we are using Docusaurus v2, the following code will be executed when the main branch is updated.
Bash
npm install; npm run build;

If there are no errors after executing the above command, the specified directory will be published as the root directory.

Bash
build

After verifying that all settings are correct, click the `Deploy site` button to deploy the site.

Site Deployment

Basically, pressing the `Deploy site` button will start the deployment. The `Site deploy in progress` message on the following screen will change to the URL when the deployment is complete.

netlify07.png

After the URL is displayed, click on it and you will see that the site is actually up and running.

netlify08.png

You can automate Build and Deploy using code deployed on GitHub with little concern for server configuration.

Summary

Since we use Docusaurus, we don't have any convenient tools for editing as you see it, but if you want to publish your notes like on this site, it is convenient to write them in Markdown, But if you want to publish your notes like this site, it is convenient to write them in Markdown. If you write code, it is automatically built and the site is up and running, which is very helpful.

Now, if you have your own domain, let's set it up.

Tags