| name | deploy-netlify |
| description | Deploys funnel pages to Netlify. Covers CLI setup, deploy commands, environment variables, custom domains, and redirect configuration.
|
Deploy to Netlify
Prerequisites
- Node.js installed
- Netlify account (free tier works for funnels)
Setup
npm install -g netlify-cli
netlify login
netlify init
Deploy Commands
netlify deploy --dir=.
netlify deploy --dir=. --prod
Netlify Configuration (netlify.toml)
[build]
publish = "."
[[redirects]]
from = "https://www.example.com/*"
to = "https://example.com/:splat"
status = 301
[[redirects]]
from = "/*"
to = "/404.html"
status = 404
[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "public, max-age=300"
[[headers]]
for = "/*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/*.webp"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
Custom Domain
- Go to Site settings → Domain management → Add custom domain
- Add a CNAME record pointing to
[site-name].netlify.app
- Enable HTTPS (automatic with Let's Encrypt)
Environment Variables
Set via Netlify dashboard: Site settings → Environment variables
Or via CLI: netlify env:set KEY value
Form Handling
Netlify has built-in form handling — add netlify attribute:
<form name="lead-capture" method="POST" data-netlify="true">
<input type="email" name="email" required>
<button type="submit">Subscribe</button>
</form>