Best Way To Host Static Website
Best Way To Host Static Website - Static web (Static Web) is a website whose content is static / does not change. Once created and online on the Internet, in general, the web cannot be replaced unless it is replaced manually by changing the programming language of the web. Therefore, the relationship is also very rare, so it can be mentioned as an online circular because the information provided is limited.
Excess Static Website
- No programming skills needed to create static pages
- Can be watched directly by the browser site without the need for a server program
- Easier for web development using HTML programming language
- Deficiency
- The appearance is not attractive
- Content is static, does not switch
- Limited in relationship with clients
- Do not use a database
- Do not use PHP programming on the server
GitHub Pages
GitHub is a free service for hosting and sharing the source code of your program or website with someone. Or we can say, GitHub is a social medium for programmers and developers.
Another feature offered by GitHub apart from hosting our program code is that GitHub provides a service called GitHub Pages. There we can have a free subdomain and the source code that we have uploaded initially can be published and watched online. With a note, the program code should be program code from a static site.
Static web means, the web that is made only contains HTML, CSS, and Javascript. There we are not allowed to use PHP and others.
GitHub Pages is very useful if you don't have the money to rent paid hosting and want to quickly publish your web creations online. Although the domain used is still a subdomain of GitHub, but you can set it to use your own TLD (great domain level).
And GitHub Pages does not provide database support, so the web that can be shown is only in the form of a static site. This deficiency causes us to be unable to make the web that has been made more interactive, such as making it for blogging, adding forms for contacts, input and others.
How to Create Github Pages
- Log in or register to github.com
- Create new repositories
- Name the repositories according to the website that will be created
- Download free-CSS-templates at free-css.com
- Edit CSS-templates
- Upload to the Github repository that was created earlier
- Then go to settings > pages >> Source >>> main >>>> save
- You will get the website address created there
- Congratulations, your GitHub page has been successfully created
My Static Website GitHub: https://akuhnet.github.io/akuhnetwork
Netlify
How to Create Static Website Netlify
- First, go to app.netlify.com
- Then login with GitHub
- After successful login select a new site from git
- Then Continuous Deployment with Github
- Select the repository that contains the GitHub pages that were created earlier
- After that create a new file named .ruby-version in the GitHub repository fill it with:
- Then create a new file named Gemfile fill with:
- After the file has been successfully created, return to the app. netlify select deploy
- Wait a while until the deployment is complete
- Congratulations, the Static Website from Netlify has been successfully created
Vercel
Excess :
- Simple deployment
- Easy implementation and production-ready with 1 command.
- Simple mapping, including automatic mapping
- Support SSR (Server-Side Rendering)
- Free tier
- Free SSL
How to Create a Static Website Vercel
- First, you have to go to vercel.com
- Select Start Deploy
- Since this is still related to GitHub then login with GitHub
- Phone number verification
- After successful login with GitHub
- Choose New Project
- Import Git Repository
- Select the Static Website Repository that was created on GitHub earlier then import
- Then wait a while to deploy
- After the deployment is complete go to the dashboard where you will see the address of the newly created website
My Static Website vercel: https://akuhnetwork.vercel.app
GitLab
My Static Website GitLab: https://akuhnet.gitlab.io/akuhnetwork
Firebase
How To Make A Static Website With Firebase
- Log in to Google using Gmail
- Go to firebase site at firebase.google.com
- Select start
- Then add a project, name the project according to the name of the website that will be created
- In the menu on the right select hosting then get started
- Download node.js at nodejs.org then install
- After installed go to the website folder that was created when creating Github pages
- Press CTRL + SHIFT + right-click on the website folder
- Open windows terminal
- After opening the terminal in the website folder, enter the following command:
- Then log in to firebase in terminal windows with command
- Proceed by selecting Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
- Press <space> then enter
- The next step is to enter all the HTML and CSS files that were created when creating GitHub pages into the public folder
- Then deploy to firebase with the command
My Static Website firebase: https://akuhnetwork.web.app
This tutorial is for educational purposes only
if this tutorial doesn't work please comment, akuh.net will update soon