benjypng / notion-dailyreflections

notion-dailyreflections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

A simple Docker container to automatically send daily reflections to Notion, using cron schedule expressions. Container is deployed to Unraid or AWS Lambda + CloudWatch.

Deployment Instructions

AWS Lambda

  1. Run the following:
npm run docker:build
npm run docker:tag -- <insert ECR URI>
npm run docker: push -- <insert ECR URI>
  1. In AWS Lambda, update to the new image.

  2. Test.

  3. Setup CloudWatch based on the cron configuration of your choosing.

Unraid

Configuration

  1. In index.ts (refer to an older commit), change the cron configuration to one of your choosing. For explanation on how cron works, visit Crontab Guru. In the same file, make changes to the Timezone if necessary.
  2. Save the changes and push to docker hub. A sample of the bash script can be found below:
docker buildx build --platform=linux/amd64 -t notion-dailyreflections .

docker tag notion-dailyreflections your-name/notion-dailyreflections

docker push your-name/notion-dailyreflections
  1. Proceed to the deployment instructions below

After making changes to the configuration, proceed with the below:

Deployment

  1. Go to Docker tab in Unraid
  2. Create a new container
  3. Repository should be set to your-name/notion-dailyreflections (based on your configuration above)
  • This assumes you have pushed your docker image to Docker Hub
  1. Change from Basic view to Advanced view
  2. Under Extra Parameters, add the below, and proceed to create the container.
--platform=linux/amd64 -e NOTION_TOKEN=XXX -e DATABASE_ID=XXX -e GOSPEL_API=XXX
# Replace XXX with your Notion token, Notion Database ID and Gospel API from https://api.esv.org

Credits

About

notion-dailyreflections


Languages

Language:TypeScript 82.4%Language:Dockerfile 8.9%Language:JavaScript 8.7%