Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Deploy Sync Rules
name: Deploy Sync Streams

on:
push:
branches:
- main
- new-cli
paths:
- "sync-rules.yaml"
- "sync-config.yaml"

permissions:
contents: read
Expand All @@ -26,12 +27,12 @@ jobs:
- name: Install PowerSync CLI
run: npm install powersync

- name: Deploy sync rules
- name: Deploy sync config
env:
AUTH_TOKEN: ${{ secrets.POWERSYNC_AUTH_TOKEN }}
PS_ADMIN_TOKEN: ${{ secrets.POWERSYNC_AUTH_TOKEN }}
INSTANCE_ID: ${{ secrets.POWERSYNC_INSTANCE_ID }}
PROJECT_ID: ${{ secrets.POWERSYNC_PROJECT_ID }}
ORG_ID: ${{ secrets.POWERSYNC_ORG_ID }}
run: |
npx powersync instance sync-rules deploy --filePath ./sync-rules.yaml -s
npx powersync deploy sync-config --directory=.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## GitHub Actions Sync Rules Demo
## GitHub Actions Deploy Sync Streams Demo

This repository shows how to deploy PowerSync Sync Rules to an instance whenever a push to the `main` branch includes changes to `sync-rules.yaml`. The included GitHub Actions workflow installs the PowerSync CLI and runs the deployment command automatically.
This repository shows how to deploy PowerSync sync config to an instance whenever a push to the `main` branch includes changes to `sync_config.yaml`. The included GitHub Actions workflow installs the PowerSync CLI and runs the deployment command automatically.

## Prerequisites

Expand Down
11 changes: 11 additions & 0 deletions sync-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
streams:
owned_lists:
query: SELECT * FROM lists WHERE owner_id = auth.user_id()
list_todos:
query: SELECT * FROM todos WHERE list_id = subscription.parameter('list_id') AND list_id IN (SELECT id FROM lists WHERE owner_id = auth.user_id())

config:
# see https://docs.powersync.com/sync/advanced/compatibility
# this edition also deploys several backwards-incompatible fixes
# see the docs for details
edition: 3
5 changes: 0 additions & 5 deletions sync-rules.yaml

This file was deleted.