Prerequisites
- An Evidence project in a Git repository (GitHub, GitLab, or Bitbucket)
- A Netlify account
- Your data sources configured and tested locally
Deployment Steps
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repository-url>
git push -u origin main
npm run sources && npm run buildbuildEVIDENCE_ prefixEVIDENCE_SOURCE__[datasource]__hostEVIDENCE_SOURCE__[datasource]__databaseEVIDENCE_SOURCE__[datasource]__userEVIDENCE_SOURCE__[datasource]__password
Never commit credentials to your Git repository. Always use environment variables for sensitive data.
Configuration Options
Custom Domain
To use a custom domain:- Go to Site settings > Domain management
- Click Add custom domain
- Follow the instructions to configure DNS
Build Hooks
Set up build hooks to trigger deployments:- Go to Site settings > Build & deploy > Build hooks
- Click Add build hook
- Name your hook (e.g., “Scheduled rebuild”)
- Use the webhook URL to trigger builds via API or scheduled jobs
Redirects and Rewrites
Create anetlify.toml file in your project root:
Continuous Deployment
Netlify automatically rebuilds your site when you push to your repository:Troubleshooting
Build Fails with Memory Error
Increase the Node.js memory limit innetlify.toml:
Build Command Not Found
Ensure yourpackage.json includes the build scripts:
Data Source Connection Fails
- Verify environment variables are set correctly in Netlify
- Check that your data source is accessible from Netlify’s servers
- Review build logs for specific error messages
- Test locally with the same environment variables
Build Takes Too Long
Optimize your build:- Use
--changedflag to build only modified queries:npm run sources -- --changed - Reduce the amount of data queried during build time
- Consider pre-aggregating data in your database
Next Steps
- Configure rendering modes
- Set up scheduled rebuilds for fresh data
- Enable deploy previews for pull requests