Skip to content

Commit 001a9ac

Browse files
author
Alexey Panfilov
committed
Add GitHub Actions build, .env.example, update README with Granola API key instructions
1 parent 933c503 commit 001a9ac

4 files changed

Lines changed: 63 additions & 5 deletions

File tree

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
GRANOLA_API_KEY=grn_...
2+
3+
GOOGLE_CLIENT_ID=...
4+
GOOGLE_CLIENT_SECRET=...
5+
GOOGLE_REFRESH_TOKEN=
6+
7+
GOOGLE_DRIVE_FOLDER_ID=
8+
9+
# How often to re-sync (e.g. 1h, 30m, 6h)
10+
SYNC_INTERVAL=1h

.github/workflows/docker.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: .
36+
push: true
37+
platforms: linux/amd64,linux/arm64
38+
tags: |
39+
ghcr.io/dzarlax-ai/granola-drive-sync:latest
40+
ghcr.io/dzarlax-ai/granola-drive-sync:${{ github.sha }}

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ A hidden file stored in the root of your Drive folder. It maps each Granola note
1919

2020
## Setup
2121

22-
### 1. Google Cloud credentials
22+
### 1. Granola API key
23+
24+
1. Open the Granola app → **Settings → Integrations → API**
25+
2. Generate a new API key
26+
3. Copy it into `.env` as `GRANOLA_API_KEY`
27+
28+
### 3. Google Cloud credentials
2329

2430
1. Go to [Google Cloud Console](https://console.cloud.google.com/)**APIs & Services → Enable APIs** → enable **Google Drive API**
2531
2. **Credentials → Create Credentials → OAuth 2.0 Client ID → Desktop app** — download the JSON
2632
3. Copy `client_id` and `client_secret` into `.env`
2733

28-
### 2. Get a refresh token (one-time, run locally)
34+
### 4. Get a refresh token (one-time, run locally)
2935

3036
```bash
3137
go build -o granola-sync .
@@ -35,7 +41,7 @@ export $(grep -v '^#' .env | xargs)
3541

3642
A browser window will open. After authorizing, copy the printed `GOOGLE_REFRESH_TOKEN` into `.env`.
3743

38-
### 3. Configure `.env`
44+
### 5. Configure `.env`
3945

4046
```env
4147
GRANOLA_API_KEY=grn_...
@@ -56,9 +62,11 @@ SYNC_INTERVAL=1h
5662
https://drive.google.com/drive/folders/<FOLDER_ID>
5763
```
5864

59-
### 4. Run
65+
### 6. Run
6066

6167
```bash
68+
cp .env.example .env # fill in your values
69+
docker compose pull
6270
docker compose up -d
6371
docker compose logs -f
6472
```

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
services:
22
granola-sync:
3-
build: .
3+
image: ghcr.io/dzarlax-ai/granola-drive-sync:latest
44
restart: unless-stopped
55
env_file: .env

0 commit comments

Comments
 (0)