In config.yml
This guide covers Phase 12 of the Quick Start β deploying your Jekyll site to GitHub Pages, Azure, or any static hosting provider.
GitHub Pages (Free β Recommended for Starters)¶
GitHub Pages is the simplest way to host a Jekyll site. It's free, automatic, and tightly integrated with your repository.
Setup Steps¶
- Push your repo to GitHub
- Go to Settings β Pages
- Set source to GitHub Actions (recommended) or the
gh-pagesbranch - Your site will be live at
https://username.github.io/repo-name/
Custom Domain¶
To use your own domain:
Step 1 β Configure Jekyll:
Step 2 β Create CNAME file:
Create a CNAME file at the repo root containing your domain:
Step 3 β Configure DNS:
Add these records with your domain registrar:
| Type | Name | Value |
|---|---|---|
| A | @ |
185.199.108.153 |
| A | @ |
185.199.109.153 |
| A | @ |
185.199.110.153 |
| A | @ |
185.199.111.153 |
| CNAME | www |
username.github.io |
Step 4 β Enable HTTPS:
In Settings β Pages, check Enforce HTTPS (available after DNS propagates).
Azure Static Web Apps¶
For more control, use Azure Static Web Apps with the IT-Journey deployment script:
./scripts/azure-jekyll-deploy.sh deploy \
--app-name my-jekyll-site \
--github-repo https://github.com/username/repo
Azure Configuration¶
| Setting | Value |
|---|---|
| App location | / |
| API location | api/ |
| Output location | _site/ |
The script handles: - Azure resource creation - GitHub Actions workflow generation - Secret configuration - Domain setup
Script Subcommands¶
# Full deployment
./scripts/azure-jekyll-deploy.sh deploy --app-name <name> --github-repo <url>
# Setup only (configure without deploying)
./scripts/azure-jekyll-deploy.sh setup
# Clean up resources
./scripts/azure-jekyll-deploy.sh cleanup --force
Manual Build + Any Host¶
Build the site and upload the output to any static hosting provider:
# Build the production site
JEKYLL_ENV=production bundle exec jekyll build
# The _site/ folder contains all static files
# Upload _site/ contents to your host
Compatible Hosts¶
| Host | Method | Notes |
|---|---|---|
| Netlify | Git push or drag-and-drop | Auto-builds from repo |
| Vercel | Git push | Auto-builds from repo |
| Cloudflare Pages | Git push | Auto-builds from repo |
| AWS S3 + CloudFront | CLI upload | aws s3 sync _site/ s3://bucket/ |
| Any web server | FTP/SCP upload | Upload _site/ contents to docroot |
Environment-Specific Builds¶
| Environment | Build Command | Config |
|---|---|---|
| Development | bundle exec jekyll serve --config _config.yml,_config_dev.yml |
Local theme, drafts visible |
| Production | JEKYLL_ENV=production bundle exec jekyll build |
Remote theme, minified, no drafts |
| Docker | docker-compose up -d |
Uses both configs automatically |
The JEKYLL_ENV variable controls environment-specific behavior:
{% raw %}{% if jekyll.environment == "production" %}
{% include analytics.html %}
{% endif %}{% endraw %}
Deployment Checklist¶
- Site builds without errors locally
-
_config.ymlhas correcturlandbaseurl -
CNAMEfile present (for custom domains) - DNS records configured and propagated
- HTTPS enforced
- All images optimized
- No draft posts published accidentally
-
robots.txtandsitemap.xmlgenerated
What's Next¶
| Next Step | Guide |
|---|---|
| Set up CI/CD for automated deployment | CI/CD & Automation |
| Optimize for SEO, performance, and accessibility | Optimization & Maintenance |
IT-Journey Quests: GitHub Pages Basics Β· Azure Ascension Β· CI/CD Fundamentals
External Docs: GitHub Pages Docs Β· Azure Static Web Apps Β· Jekyll Deployment