Overview
Pulse Content uses GitHub Actions for continuous integration and deployment:- ✅ Automated testing on every push and pull request
- 🚀 Automatic deployment to Cloudflare Pages on main branch
- 🔍 Type checking to catch errors before deployment
- 📦 Dependency caching for faster builds
Workflow Configuration
File Location
.github/workflows/deploy.yml
Workflow Structure
Pipeline Stages
Stage 1: Test Job
Stage 2: Deploy Job
Conditional execution: Only runs if:
- Test job passes
- Push is to
mainbranch
GitHub Secrets
Required Secrets
Add these in GitHub repository settings: Location: Settings > Secrets and variables > Actions > New repository secretCloudflare API token with Cloudflare Pages:Edit permissionsGenerate:
- Go to dash.cloudflare.com/profile/api-tokens
- Click Create Token
- Use Edit Cloudflare Workers template
- Add Cloudflare Pages:Edit permission
- Copy token (only shown once)
Optional Secrets
For additional features:Workflow Triggers
On Push to Main
Automatic deployment:- Developer merges PR to
main - GitHub Actions runs test job
- If tests pass, deploy job runs
- Code deploys to production
On Pull Request
Tests only (no deployment):- Developer opens PR
- GitHub Actions runs test job
- PR shows test status ✅ or ❌
- No deployment occurs
Manual Trigger (Optional)
Add workflow_dispatch for manual runs:Build Artifacts
Caching Strategy
Node modules cache:- 50-70% faster dependency installation
- Reduced GitHub Actions minutes usage
Build Output
Directory:dist/
Contents:
- Compiled JavaScript bundles
- Optimized CSS
- Static assets (fonts, images)
- Source maps
Deployment Previews
Cloudflare Pages automatically creates preview deployments:For Pull Requests
- Unique URL per PR
- Automatic updates on new commits
- No production impact
https://a1b2c3d4.pulse-content.pages.dev
Preview Comments
Cloudflare bot comments on PR with preview URL:Monitoring Deployments
GitHub Actions UI
View workflow runs:- Go to repository Actions tab
- See all workflow runs with status
- Click run for detailed logs
- ✅ Success (tests passed, deployed)
- ❌ Failure (tests failed, not deployed)
- 🟡 In Progress
Cloudflare Dashboard
View deployments:- Go to dash.cloudflare.com
- Navigate to Workers & Pages > pulse-content
- See deployment history, logs, analytics
Troubleshooting
Tests fail in CI but pass locally
Tests fail in CI but pass locally
Common causes:
- Environment variables missing
- Different Node.js versions
- Race conditions in async tests
Deployment fails with authentication error
Deployment fails with authentication error
Verify:
CLOUDFLARE_API_TOKENis set correctly- Token has Cloudflare Pages:Edit permission
- Token hasn’t expired
- Create new token in Cloudflare
- Update GitHub secret
- Re-run workflow
Build succeeds but deployment fails
Build succeeds but deployment fails
Check:
dist/directory exists and contains fileswrangler.tomlconfiguration is correct- Project name matches:
pulse-content
Workflow runs but doesn't deploy
Workflow runs but doesn't deploy
Verify conditions:
- Push is to
mainbranch (notdevelopor other) - Test job passed successfully
needs: testdependency is correct
Performance Optimization
Parallel Jobs
Run independent jobs in parallel:Matrix Testing
Test across multiple Node versions:Next Steps
Cloudflare Deployment
Manual deployment guide
Environment Config
Manage environment variables
Testing Strategy
Learn about testing
Contributing
Contribution guidelines