Publish Your Website: Static Hosting, GitHub Pages, Netlify, Custom Domains, DNS Records and HTTPS Step by Step
Static vs Dynamic Sites
| Static site | Dynamic site | |
|---|---|---|
| Files | Ready HTML, CSS, JavaScript, images | Pages built by a server for each visit |
| Examples | Portfolio, landing page, documentation | Shop, social network, booking system |
| Hosting | Simple and often free | Needs server, database and more setup |
This course focuses on static sites, which is the best place to start.
Where to Host
| Option | Notes |
|---|---|
| GitHub Pages | Free hosting from a GitHub repository for static sites |
| Netlify, Vercel, Cloudflare Pages | Connect a Git repository and they build and deploy on every push |
| Shared or cloud hosting | Upload files with FTP or a control panel |
Check current plans Free plans, limits and screens change over time. Read the host's current documentation before you depend on a feature.
Deploy with GitHub Pages (Outline)
- Push your project to a GitHub repository with
index.htmlat the root - Open the repository Settings, then Pages
- Choose the branch and folder to publish
- Wait a minute and open the address shown (it looks like
username.github.io/repo-name) - Fix paths if CSS or images do not load (use relative paths such as
css/style.css)
Deploy with a Git-Connected Host (Outline)
- Sign in and choose Add new site, Import from Git
- Select your repository
- If your site has no build step, leave build empty and set the publish folder to the project root
- Click Deploy
- Every push to main now redeploys automatically
Custom Domain
- Buy a domain from a registrar
- In your host, add the custom domain
- In the registrar's DNS settings, add the records the host asks for
- Wait for DNS to update (minutes to many hours)
- Turn on HTTPS (most hosts issue a free certificate automatically)
| DNS record | Purpose | Example |
|---|---|---|
| A | Points a name to an IPv4 address | example.com to 203.0.113.10 |
| AAAA | Points a name to an IPv6 address | example.com to an IPv6 address |
| CNAME | Points a name to another name | www.example.com to username.github.io |
| TXT | Text proofs, such as domain verification | A verification code |
| MX | Where email for the domain goes | Mail provider servers |
Documentation addresses The example IP address above is from a reserved documentation range. Always use the exact values your host gives you.
Why HTTPS?
- Encrypts data between visitor and site
- Browsers mark HTTP sites as not secure
- Required for many modern features
- Helps trust and search visibility
Post-Launch Checklist
- Open the site on phone and laptop
- Test every link, form and image
- Check that
http://redirects tohttps://andwwwto the main name - Test the 404 page
- Run Lighthouse
- Submit the sitemap to Search Console
- Set up analytics (with consent where needed)
- Create a backup plan
Practice
- Publish your practice site with GitHub Pages or a similar host
- Add a custom domain if you own one
- Run the post-launch checklist
Conclusion
A static site is easy to publish: push your files, let a host deploy them, add a domain and DNS records, turn on HTTPS and run a launch checklist.
Quick Summary: Static vs dynamic; hosts; GitHub Pages; Git-connected; domain; DNS; HTTPS; checklist.

