Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/tinybird.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tinybird

on:
workflow_dispatch:
pull_request:
branches:
- main
- master
types: [opened, reopened, labeled, unlabeled, synchronize]

concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number }}

env:
TINYBIRD_HOST: ${{ secrets.TINYBIRD_HOST }}
TINYBIRD_TOKEN: ${{ secrets.TINYBIRD_TOKEN }}

jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '.'
services:
tinybird:
image: tinybirdco/tinybird-local:latest
ports:
- 7181:7181
steps:
- uses: actions/checkout@v3

- name: Install Tinybird CLI
run: curl https://tinybird.co | sh

- name: Build project
run: tb build

- name: Test project
run: tb test run

- name: Deployment check
run: tb --cloud --host ${{ env.TINYBIRD_HOST }} --token ${{ env.TINYBIRD_TOKEN }} deploy --check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ tauri.windows.conf.json
# Cursor
.cursor
.env*.local

# Tinybird
.tinyb
17 changes: 17 additions & 0 deletions tinybird/datasources/analytics_views.datasource
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DESCRIPTION >
Analytics events for when the share page is opened.

TOKEN "tracker" APPEND

SCHEMA >
`timestamp` DateTime `json:$.timestamp`,
`version` LowCardinality(String) `json:$.version`,

`session_id` Nullable(String) `json:$.session_id`,
`video_id` String `json:$.video_id`,

`payload` String `json:$.payload`

ENGINE MergeTree
ENGINE_PARTITION_KEY toYYYYMM(timestamp)
ENGINE_SORTING_KEY video_id, timestamp
Loading