Phase 10 - Deployment & Monitoring
Overview
Section titled “Overview”- Tier: Polish (Phase 10 of 12)
- Duration: 1 day
- Dependencies: Phase 0-9 completed
- Deliverables: Live site, CI/CD pipeline, monitoring setup, backup strategy
Entry Criteria
Section titled “Entry Criteria”- Performance optimization complete
- All tests passing
- Content finalized
- Domain and hosting ready
Implementation Steps
Section titled “Implementation Steps”| Step | Task | Scope | Notes |
|---|---|---|---|
| 10.01 | Choose hosting platform | Essential | GitHub Pages ships preconfigured; Cloudflare Pages, Netlify, Vercel are alternatives |
| 10.02 | Configure build settings | Essential | Environment variables |
| 10.03 | Set up CI/CD pipeline | Essential | Auto-deploy on push |
| 10.04 | Configure custom domain | Essential | DNS settings |
| 10.05 | SSL certificate setup | Essential | Auto-provisioned |
| 10.06 | Deploy to staging | Essential | Preview environment (on GitHub Pages, PR checks — build, tests, Lighthouse — stand in for staging) |
| 10.07 | Production deployment | Essential | Go live |
| 10.08 | Set up monitoring | Essential | Uptime, basic metrics |
| 10.09 | Configure backups | Essential | Code and content |
| 10.10 | Error tracking | Advanced | Sentry or similar |
| 10.11 | Analytics setup | Recommended | Privacy-focused |
| 10.12 | Performance monitoring | Advanced | RUM, dashboards |
Note: The starter ships a GitHub Pages workflow out of the box (
.github/workflows/deploy.yml); Cloudflare Pages is an alternative deployment path. If you deploy to Cloudflare Pages from CI, usecloudflare/wrangler-action@v3withcommand: pages deploy dist --project-name=<name>— the oldercloudflare/pages-action@v1is deprecated. Static deploys to Cloudflare Pages need nowrangler.toml.
Security Checklist
Section titled “Security Checklist”# Production Security Checklist
## Environment- [ ] All sensitive keys in environment variables- [ ] Different keys for staging/production- [ ] No secrets in code repository- [ ] Environment variables documented
## Headers- [ ] Security headers configured- [ ] CSP policy implemented- [ ] HSTS enabled- [ ] X-Frame-Options set
## SSL/TLS- [ ] SSL certificate active- [ ] Auto-renewal configured- [ ] HTTP redirects to HTTPS- [ ] HSTS preload submitted
## Access Control- [ ] Admin routes protected- [ ] API rate limiting enabled- [ ] CORS properly configured- [ ] Authentication implemented
## Monitoring- [ ] Error tracking active- [ ] Security alerts configured- [ ] Uptime monitoring enabled- [ ] Performance tracking live
## Backups- [ ] Automated backups running- [ ] Backup restoration tested- [ ] Off-site backup storage- [ ] Backup encryption enabledCommon Pitfalls
Section titled “Common Pitfalls”-
Missing Environment Variables: Forgetting to set production variables
- Solution: Validate required variables on build
-
Cache Issues: Old content served after updates
- Solution: Implement cache busting strategy
-
SSL Problems: Certificate errors or mixed content
- Solution: Force HTTPS, update all URLs
-
Missing Redirects: Old URLs returning 404
- Solution: Set up redirect rules on a header-capable host (Cloudflare Pages, Netlify); GitHub Pages has no redirects file, so ship meta-refresh pages instead
-
Monitoring Blind Spots: Not tracking critical metrics
- Solution: Comprehensive monitoring setup
Exit Criteria
Section titled “Exit Criteria”Essential (all projects)
Section titled “Essential (all projects)”- Site deployed to production
- Custom domain configured (
SITE_URLset; see.github/workflows/deploy.yml) - SSL certificate active
- CI/CD pipeline functional (
ci.yml,lighthouse.yml,deploy.ymlgreen) - Preview deployments or PR checks working
- Uptime monitoring active
- Backups automated
- Security headers verified (
public/_headers— honoured by Cloudflare Pages/Netlify, a no-op on GitHub Pages) - Documentation updated
Recommended (most projects)
Section titled “Recommended (most projects)”- Analytics configured (privacy-focused; opt-in, not shipped)
Advanced (portfolio/enterprise)
Section titled “Advanced (portfolio/enterprise)”- Error tracking enabled (Sentry or equivalent)
- Performance monitoring live (RUM dashboards)
- Alerting configured for error rate thresholds
Rollback Strategy
Section titled “Rollback Strategy”If deployment issues occur:
-
Failed Deployment:
- Use previous successful build
- Check build logs for errors
- Verify environment variables
-
Production Issues:
- Immediate rollback available
- Use preview deployments for testing
- Monitor error rates
-
Performance Degradation:
- Check CDN configuration
- Verify caching headers
- Review recent changes
AI Assistant Notes
Section titled “AI Assistant Notes”Key Files to Reference
Section titled “Key Files to Reference”.github/workflows/deploy.yml- Shipped GitHub Pages deploy (resolvesSITE_URL/DEPLOY_TARGET).github/workflows/ci.yml,lighthouse.yml- Quality and Lighthouse gates.env.example- Environment variable setup (pnpm run env:validateruns before every build)public/_headers- Security and caching headersastro.config.mjs-site/basederived fromSITE_URLandDEPLOY_TARGET
Common Prompts for This Phase
Section titled “Common Prompts for This Phase”- “Point the GitHub Pages deploy at a custom domain”
- “Set up Cloudflare Pages deployment as an alternative”
- “Configure GitHub Actions for CI/CD”
- “Implement error tracking with Sentry”
- “Create automated backup strategy”
Context Requirements
Section titled “Context Requirements”- Hosting platform choice
- Domain name
- Analytics preferences
- Monitoring requirements