Skip to content

Commit

Permalink
Add Redis documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed Apr 5, 2022
1 parent 12adde0 commit 6308fd7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ jobs:
cache: yarn

- run: yarn install --frozen-lockfile
- run: yarn build
- name: build
# TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets
# env:
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
# REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
run: yarn build
24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ In order to find your Notion workspace ID (optional), just load any of your site

I recommend setting up a collection on your home page (optional; I use an inline gallery [here](https://notion.so/78fc5a4b88d74b0e824e29407e9f1ec1)) that contains all of your articles / projects / content. There are no structural constraints on your Notion workspace, however, so feel free to add content as you would normally in Notion.

## Production setup

When deploying to Vercel, you'll need to set up a few things.

### Vercel environment variables

Vercel is not aware of the environment variables defined in the `.env` file.

Therefore, those variable must be defined in Vercel, too. Once defined, they'll be available on the next builds.
See [their documentation](https://vercel.com/docs/concepts/projects/environment-variables) for more details.

## URL Paths

The app defaults to slightly different URL paths in dev vs prod (though pasting any dev pathname into prod will work and vice-versa).
Expand Down Expand Up @@ -92,6 +103,19 @@ REDIS_PASSWORD='TODO'

Note that preview images and redis caching are both optional features. If you’d rather not deal with them, just disable them in your site config.

### Configuring GitHub Actions

By default, the workflow "[Build](https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/main/.github/workflows/build.yml)" runs when commits are pushed to the repository.

If you have defined a Redis instance, you will need to slightly change the configuration, for GitHub Actions to be aware of those environment variables.
[Here is an example](https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/transitive-bullshit/.github/workflows/build.yml#L17-L21)

Additionally, you'll need to configure the [GitHub secrets](https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces) for `REDIS_HOST` and `REDIS_PASSWORD`.

### Redis provider

If you want to use redis caching, you can use [Redis Labs](https://app.redislabs.com/), which provides a free plan.

## Styles

All CSS styles that customize Notion content are located in [styles/notion.css](./styles/notion.css). They mainly target global CSS classes exported by react-notion-x [styles.css](https://github.com/NotionX/react-notion-x/blob/master/packages/react-notion-x/src/styles.css).
Expand Down

0 comments on commit 6308fd7

Please sign in to comment.