Netlify lets you host a public version of your project for free, or you can create and host a password-protected version with Netlify's $15/month plan.
You can sign up for Netlify here
- On your overview page, click to create a new site from Git:
- Follow the prompts from Netlify to connect to your GitHub and choose the repo containing your Evidence project
- Use the default options supplied by Netlify and click Deploy Site. Netlify will start building your site and you should see the screen below:
Since your database credentials are not checked into version control (they are included in the
.gitignore file in your project), you need to provide Netlify with the credentials to access your database. You can set up environment variables in Netlify for this.
- Go to Site Settings
- Under Build & deploy, go to Environment
- Click Edit in the Environment Variables section
- Add each required environment variable to connect to your database (see below for the required variables based on which database you're using)
You will need the 3 variables below from the JSON key file you generated for your BigQuery service account. If you don't have a JSON key file, see Connect Data Warehouse.
Netlify will already have deployed a version of your site without the environment variables, but now you'll need to update it so the queries in your project work.
Go to Deploys and click Trigger deploy - this will kickstart a new build of your project.
Once the deploy is complete, refresh your project site and your queries should be working.
Follow the directions provided by Netlify to set up a password for your site: https://docs.netlify.com/visitor-access/password-protection/
If you want your site to update on a specific schedule, you can use GitHub Actions. You provide a schedule in your GitHub repo (details below) and GitHub will send a request to Netlify to trigger a rebuild of your site on that schedule (using a specific URL provided by Netlify; AKA a build hook).
Create a Netlify build hook in Site settings > Build & deploy > Continuous deployment > Build hooks This will give you a URL that GitHub will use to trigger builds
NETLIFY_BUILD_HOOKto your Github Repo's Secrets
- In your GitHub repo, go to Settings > Secrets > Actions and click New repository secret
- Add a schedule file to your project
- Create a new directory in your project called
- Within that directory, create another called
- Add a new file in
- Add the following text to the
main.ymlfile you just created. Be sure that the spacing and indentation is exactly as presented here, as it will impact whether the action runs correctly
- See your GitHub Actions run in the Actions tab of your GitHub repo