github pages vs netlify

Github Pages is a static site hosting service provided by Github. It directly obtains static files from Github repository for publishing, and then provides a Github. IO secondary domain name for users to access, support binding custom domain name, support HTTPS. HTTPS will automatically apply for certificates and renew them before they expire. It’s all free and extremely simple to use. Just submit your static files to Github and start the Pages service, which hosts my blog

Github Pages is a free and stable service that allows me to focus on content without considering cost and maintenance. It is very convenient and widely praised. However, one of the biggest problems of Github Pages is the slow access speed in China. Here’s a service: Netlify

Netlify is a comprehensive platform to provide static website hosting, support automatically from Github and other repositories to pull the code and build a static website to publish, but also support self-defining domain name, automatic application SSL certificate and other functions, more importantly, automatic enable CDN acceleration, domestic access speed is much faster

Below is a comparison of Github Pages and Netlify’s request speed for the same project

Netlify beat Github Pages in all parts of the country. How to speed up Github Pages with Netlify

Netlify

Go to the Netlify website and click the Sign Up button in the upper right corner to Sign up for your account. It is recommended to associate with your Github account

After associated authentication, enter the background page of Netlify, as shown in the picture below. Click New Site from Git

Select Github, Gitlab, and Bitbucket

Then go to Github’s authentication and authorization page and click Authorize Netlify by Netlify

Select Only Select Repositories to authorize the Github repository, or authorize all repositories. This authorization can be changed in setup

Go back to the Netlify background page and select the Github repository we just authorized to continue

You can select the user and branch to Deploy to. If you need to compile a project, you can define the command to compile the project and the directory to publish the project. You can click Deploy Site to Deploy the project

After the deployment is complete, Netlify automatically generates a random secondary domain name. Netlify.com. You can change the secondary domain name to a customized one by clicking Site Settings

General -> Site details Click Change Site Name to set a custom name for the Site. The secondary domain name will also Change accordingly

If you want to bind your own domain name, you need to create a resolution in the domain name Management system, and point the domain name CNAME to your Netlify secondary domain name, using AliCloud as an example

Go to Domain Management -> Domains, go to Add Domain Alias and Add your Domain name

After domain name resolution takes effect, the newly bound domain name turns green and is set to the primary domain name

To enable HTTPS for custom Domain names, go to Domain Management -> HTTPS and click Verify DNS Configuration. If the Domain name is authenticated, the certificate will be automatically applied

Netlify is now bound to Github, so you can use your own domain name to access the site. Every time you submit code to Github, it will be automatically published to Netlify

Other instructions

If you are A primary domain that is bound to Netlify and must be logged using A, you can ping your Netlify secondary domain address to obtain the IP address. For example, my domain name is ops-coffee.netlify.com. After ping, the IP address is 157.230.35.153. You can ping multiple times to obtain different IP addresses, which are bound to the domain name to prevent single node failure

In China, there are similar services like Github Pages, such as Pages provided by Gitee and Coding, which have many advantages in speed, but lack stability and may face problems such as multiple censorship of domain name registration

If your domain name has been put on record, the project is pure static then you can also consider hosting directly in some domestic object storage services, such as seven Niuyun, Tencent cloud, etc., and then open CDN acceleration, the effect is also good, and most of the free flow can be used

Github Pages and Netlify are free and highly customizable solutions that meet our personalized needs without maintenance costs and financial stress, and keep the site alive longer, allowing us to focus on continuous output, creating a positive cycle. Give it a try

Finally, if you are interested in my blog implementation, this article has introduction and source code: Use Django freehand to write a static page generation tool, if the hard work of writing articles no one visits, perhaps this can help you: Google search as the biggest entry, briefly talk about personal blog SEO