Overview
CV Staff Web is built with Astro and generates static files, making it compatible with virtually any static hosting platform. This guide covers the most popular and recommended hosting options.
All of these platforms offer:
- Free tier for personal/small projects
- Automatic HTTPS/SSL certificates
- Global CDN distribution
- Automatic deployments from Git
- Environment variable management
Vercel
Vercel offers excellent support for Astro applications with zero configuration.
Quick Deploy
-
Install Vercel CLI (optional):
-
Deploy from CLI:
npm run build
vercel --prod
Deploy from Git
-
Push your code to GitHub, GitLab, or Bitbucket
-
Visit vercel.com and sign in
-
Click “New Project”
-
Import your repository
-
Vercel auto-detects Astro and configures:
- Build Command:
npm run build
- Output Directory:
dist
- Install Command:
npm install
-
Add environment variables:
- Go to Project Settings → Environment Variables
- Add
PUBLIC_GROQ_API_KEY and other required variables
-
Click “Deploy”
Custom Configuration
Create vercel.json in your project root for advanced settings:
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"framework": "astro",
"regions": ["iad1"]
}
Netlify
Netlify provides seamless deployment with excellent developer experience.
Quick Deploy
-
Install Netlify CLI:
npm install -g netlify-cli
-
Deploy:
npm run build
netlify deploy --prod
Deploy from Git
- Push your code to a Git repository
- Visit netlify.com and sign in
- Click “Add new site” → “Import an existing project”
- Connect your Git provider and select your repository
- Configure build settings:
- Build command:
npm run build
- Publish directory:
dist
- Add environment variables in Site Settings → Environment Variables
- Click “Deploy site”
Configuration File
Create netlify.toml for custom configuration:
[build]
command = "npm run build"
publish = "dist"
[build.environment]
NODE_VERSION = "18"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
Cloudflare Pages
Cloudflare Pages offers global edge deployment with excellent performance.
Deploy from Git
- Push your code to GitHub or GitLab
- Visit pages.cloudflare.com
- Sign in and click “Create a project”
- Connect your Git account and select repository
- Configure build settings:
- Framework preset: Astro
- Build command:
npm run build
- Build output directory:
dist
- Add environment variables in Settings → Environment Variables
- Click “Save and Deploy”
Wrangler CLI Deployment
npm install -g wrangler
wrangler pages deploy dist
Custom Headers and Redirects
Create public/_headers:
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Create public/_redirects:
/old-page /new-page 301
/* /index.html 200
GitHub Pages
Free hosting directly from your GitHub repository.
Setup
-
Update
astro.config.mjs:
import { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://username.github.io',
base: '/repository-name',
});
-
Create GitHub Actions workflow (
.github/workflows/deploy.yml):
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
PUBLIC_GROQ_API_KEY: ${{ secrets.PUBLIC_GROQ_API_KEY }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
-
Configure GitHub Pages:
- Go to repository Settings → Pages
- Source: “GitHub Actions”
- Add secrets in Settings → Secrets and Variables → Actions
Render
Render provides free static site hosting with automatic deployments.
Deploy from Git
- Visit render.com and sign in
- Click “New” → “Static Site”
- Connect your Git repository
- Configure:
- Build Command:
npm run build
- Publish Directory:
dist
- Add environment variables
- Click “Create Static Site”
Environment Variables Setup
For all platforms, ensure you configure these environment variables:
Required Variables
PUBLIC_GROQ_API_KEY=your_groq_api_key_here
The PUBLIC_ prefix exposes variables to client-side code. Only use this prefix for non-sensitive data or properly secured API keys.
- Vercel: Project Settings → Environment Variables → Add
- Netlify: Site Settings → Environment Variables → Add variable
- Cloudflare: Settings → Environment Variables → Add variable
- GitHub Pages: Repository Settings → Secrets and Variables → Actions → New secret
- Render: Environment → Add Environment Variable
Custom Domain Setup
All platforms support custom domains:
-
Add domain in platform dashboard:
- Vercel: Project Settings → Domains
- Netlify: Site Settings → Domain Management
- Cloudflare: Custom Domains
- GitHub Pages: Settings → Pages → Custom Domain
-
Configure DNS records:
- For apex domain (example.com), use A or ALIAS records
- For subdomain (www.example.com), use CNAME record
- Follow platform-specific DNS instructions
-
SSL/HTTPS: Automatically provisioned by all platforms
CDN Configuration
All recommended platforms provide global CDN by default:
- Static assets are cached at edge locations
- Automatic compression (Brotli/Gzip)
- HTTP/2 and HTTP/3 support
Optimize caching by configuring headers:
Netlify (netlify.toml):
[[headers]]
for = "/_astro/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
Vercel (vercel.json):
{
"headers": [
{
"source": "/_astro/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}
Deployment Checklist
Before deploying to production:
Monitoring and Analytics
Consider adding these services:
- Vercel Analytics: Built-in Web Vitals monitoring
- Netlify Analytics: Server-side analytics
- Cloudflare Analytics: Built-in traffic analytics
- Google Analytics: Third-party analytics
- Sentry: Error tracking and monitoring
Rollback and Versioning
All platforms support instant rollbacks:
- Vercel: Deployments tab → Previous deployment → Promote to Production
- Netlify: Deploys tab → Previous deploy → Publish deploy
- Cloudflare: Deployments → View build → Rollback
- GitHub Pages: Revert commit and re-run workflow
Next Steps
- Review Build Configuration for optimization tips
- Set up continuous deployment with Git integration
- Configure monitoring and analytics
- Implement A/B testing (platform-specific features)