Deploy to Netlify
Deploy to Netlify
Section titled “Deploy to Netlify”Deploy your podcast website to Netlify for reliable hosting with continuous deployment, serverless functions, and a generous free tier.
Quick Deploy
Section titled “Quick Deploy”- Push code to GitHub
- Connect Netlify to GitHub
- Configure build settings
- Deploy
Your site will be live at your-site.netlify.app
Step-by-Step Guide
Section titled “Step-by-Step Guide”Step 1: Push to GitHub
Section titled “Step 1: Push to GitHub”git initgit add .git commit -m "Initial commit"git remote add origin https://github.com/username/my-podcast.gitgit push -u origin mainStep 2: Create Netlify Site
Section titled “Step 2: Create Netlify Site”- Go to app.netlify.com
- Click “Add new site”
- Click “Import an existing project”
- Click “Deploy with GitHub”
- Authorize Netlify (if first time)
- Select your repository
- Click “Deploy site”
Step 3: Configure Build
Section titled “Step 3: Configure Build”Site name: my-podcast (or custom)Branch: mainBuild command: npm run buildPublish directory: distStep 4: Environment Variables
Section titled “Step 4: Environment Variables”- Site settings → Environment variables
- Add variables:
PUBLIC_SANITY_PROJECT_ID = abc123xyzPUBLIC_SANITY_DATASET = productionPUBLIC_SANITY_API_VERSION = 2024-01-01PUBLIC_SITE_URL = https://my-podcast.netlify.appOptional variables:
SANITY_API_TOKEN = sk_...RESEND_API_KEY = re_...NOTIFICATION_EMAIL = [email protected]CONVERTKIT_API_KEY = ...CONVERTKIT_FORM_ID = ...PUBLIC_GA_MEASUREMENT_ID = G-...Step 5: Deploy
Section titled “Step 5: Deploy”Click “Deploy site”
Watch deployment:
Build startedInstalling dependenciesRunning build commandBuild succeededDeploying to Netlify Edge✅ Published!Visit: https://your-site.netlify.app
Configuration File
Section titled “Configuration File”Create netlify.toml for advanced configuration:
[build] command = "npm run build" publish = "dist"
[build.environment] NODE_VERSION = "18"
[[redirects]] from = "/old-page" to = "/new-page" status = 301
[[headers]] for = "/*" [headers.values] X-Frame-Options = "DENY" X-Content-Type-Options = "nosniff"Netlify Functions
Section titled “Netlify Functions”API routes automatically become Netlify Functions.
Framework pattern:
import type { APIRoute } from 'astro';
export const POST: APIRoute = async (context) => { // Works automatically on Netlify return new Response('OK');};Becomes: .netlify/functions/example
Automatic Deployments
Section titled “Automatic Deployments”Every push to main triggers deployment:
git add .git commit -m "Add new episode"git push
# Netlify builds and deploys automaticallyCustom Domain
Section titled “Custom Domain”Add Domain
Section titled “Add Domain”- Site settings → Domain management
- Click “Add custom domain”
- Enter:
yourpodcast.com - Follow DNS instructions
DNS Setup
Section titled “DNS Setup”Add records at your DNS provider:
Type: AName: @Value: 75.2.60.5
Type: CNAMEName: wwwValue: your-site.netlify.appNetlify provisions SSL automatically via Let’s Encrypt.
Enable HTTPS:
- Domain settings → HTTPS
- Toggle “Force HTTPS” → ON
Related
Section titled “Related”- Cloudflare Pages - Alternative platform
- Environment Variables - Configure variables
- Custom Domains - Domain setup
Next Steps
Section titled “Next Steps”- Environment Variables - Add all variables
- Custom Domains - Set up domain
- Vercel - Alternative platform