โ๏ธโก Full Cloudflare Pages Deployment Walkthrough ๐
This article documents the complete real-world process used to launch this website publicly for free using GitHub ๐, Astro โก, and Cloudflare Pages โ๏ธ โ including mistakes ๐งฏ, troubleshooting ๐, deployment failures ๐ฅ, and the exact settings that were ultimately required.
Live production site:
https://personalwebsite-cx5.pages.dev/๐ฏ Goal
The objective was to create a fully free personal technical website with:
- ๐ GitHub repository hosting
- โก Astro static site framework
- โ๏ธ Cloudflare Pages deployment
- ๐ Low attack surface architecture
- ๐ Global CDN distribution
- ๐ธ Zero hosting cost
- ๐ค Future AI-agent integrations
- ๐งต Room for blogs, security notes, and maker projects
๐ง Why Astro + Cloudflare Pages?
Astro was selected because it produces static HTML output by default, which dramatically reduces attack surface ๐ compared to dynamic CMS platforms.
Cloudflare Pages was selected because:
- ๐ Global CDN included free
- โก Extremely fast static hosting
- ๐ Native GitHub integration
- ๐ HTTPS enabled automatically
- ๐ธ Generous free tier
- ๐ Automatic deploys from Git pushes
๐ Step 1 โ Create GitHub Repository
- Log into GitHub
- Create a new repository
- Name selected:
PersonalWebsite - Repository owner:
ryanthemanr0x - Visibility selected: Public ๐
- Initialize README: Yes
Final repository:
https://github.com/ryanthemanr0x/PersonalWebsiteโก Step 2 โ Build Astro Website Structure
The repository initially did not contain enough files for Cloudflare Pages to recognize it as a deployable Astro project.
The following files had to be created:
package.jsonastro.config.mjssrc/pages/index.astrotsconfig.jsonpublic/assets
Critical package scripts:
{
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview"
}
}โ๏ธ Step 3 โ Create Cloudflare Pages Project
- Log into Cloudflare dashboard
- Navigate to: Workers & Pages โ Pages
- Select: Connect to Git
- Authorize GitHub integration
- Select repository:
PersonalWebsite
This was extremely important because an earlier deployment attempt accidentally used a Wrangler/Workers flow instead of a true Pages deployment flow.
โ ๏ธ Major Mistake #1 โ Wrong Cloudflare Deployment Type
One of the largest troubleshooting problems occurred because the deployment initially ended up configured similarly to a Worker deployment instead of a true Pages deployment.
This caused:
- โ Wrangler authentication problems
- โ API token confusion
- โ Deploy command failures
- โ Pages API authentication errors
Error example:
Authentication error [code: 10000]
The fix was:
- โ Use Cloudflare Pages directly
- โ Connect repository through Pages UI
- โ Remove unnecessary Wrangler deploy usage
- โ Let Pages publish the generated dist folder automatically
๐งฏ Major Mistake #2 โ Incorrect Build Command
Another major issue happened because the Cloudflare build command field accidentally contained descriptive text instead of only the command itself.
Incorrect value entered:
Framework preset: Astro Build command: npm run build Build output directory: dist Root directory: /
Cloudflare attempted to execute these literal lines as shell commands, producing errors like:
/bin/sh: 1: Framework: not found
Correct fix:
Build command: npm run build
โ๏ธ Final Working Cloudflare Pages Settings
These were the final settings required for a successful deployment:
Framework preset: Astro Build command: npm run build Build output directory: dist Root directory: /
Important detail โ ๏ธ:
The Build Output Directory specifically had to be set to:
dist
NOT:
/
๐จ Local Development Commands
Commands used during development:
npm install npm run dev npm run build npm run preview
Git commands used:
git status git add . git commit -m "Update website" git push origin main
๐ Step 4 โ First Successful Deployment
Once the Pages project was configured correctly:
- ๐ GitHub push triggered deployment automatically
- โก Astro generated static output into
dist/ - โ๏ธ Cloudflare uploaded the generated assets globally
- ๐ Public HTTPS site became live
Cloudflare deployment logs finally showed:
โจ Success! Uploaded files โจ Upload complete! Success: Your site was deployed!
๐ Step 5 โ Hacker Theme Upgrade
After deployment stability was confirmed, the minimal starter site was replaced with a cyberpunk/hacker aesthetic featuring:
- ๐ป Terminal-style UI
- ๐ง๏ธ Matrix-style background
- ๐ค AI agent sections
- ๐ Security blog sections
- ๐งต 3D printing lab
- โ๏ธ Cloud engineering content
- ๐ Technical documentation pages
- ๐ง Linux/TMUX references
๐ Security Advantages of This Architecture
This deployment architecture intentionally minimizes risk:
- โ Static HTML output
- โ No public database
- โ No PHP runtime
- โ No WordPress plugins
- โ No exposed admin dashboard
- โ Global CDN edge caching
- โ Automatic HTTPS
- โ Git-based deployment history
๐ธ Free Tier Components Used
- ๐ GitHub Free repository hosting
- โ๏ธ Cloudflare Pages free static hosting
- โก Astro open-source framework
- ๐ Free global CDN
- ๐ Free HTTPS certificates
- ๐ Free automatic deployments
๐ Lessons Learned
- ๐งผ Keep the first deployment simple
- ๐ Static-first dramatically reduces complexity
- โ๏ธ Pages and Workers are different deployment models
- ๐งฏ Cloudflare build fields must contain ONLY commands
- ๐ GitHub-driven deployments are cleaner than manual uploads
- ๐ Document every fix while troubleshooting
- ๐ค AI agents are extremely useful for rapid iteration
๐ Final Result
The final outcome was a globally deployed ๐ hacker-themed โก low-cost ๐ธ security-focused ๐ technical website powered by:
๐ GitHub โก Astro โ๏ธ Cloudflare Pages ๐ค AI-assisted workflows ๐ง Linux tooling ๐งต Maker + 3D printing content