Skip to content

Commit

Permalink
ci: add github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmo314 committed Nov 27, 2023
1 parent 431bbc2 commit 0c8d07c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/example-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy GitHub Pages Example

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/configure-pages@v3
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
- run: |
# Fetch the data in workspace
cd examples/workspace
python3 -m pip install -r requirements.txt
python3 fetch_data.py
cd -
# Build the index
go run cmd/main.go examples/workspace/green_tripdata_2023-01.jsonl
# Copy to client
cp examples/workspace/green_tripdata_2023-01.jsonl examples/client
cp examples/workspace/green_tripdata_2023-01.jsonl.index examples/client
# Build the js lib
npm ci
npm run build
# Copy the js lib
cp dist/appendable.min.js examples/client
cp dist/appendable.min.js.map examples/client
- uses: actions/upload-pages-artifact@v2
with:
path: examples/client
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
workspace
dist
node_modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Appendable

Appendable is an append-only, schemaless, service-less database.
Appendable is an append-only, schemaless, daemon-less database.

Appendable doesn't require a conventional server, instead it generates an index
file that you can host on your favorite static hosting site.
Expand Down
8 changes: 8 additions & 0 deletions examples/workspace/fetch_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Data taken from https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page

import pandas as pd
import requests
import io

response = requests.get('https://d37ci6vzurychx.cloudfront.net/trip-data/green_tripdata_2023-01.parquet')
pd.read_parquet(io.BytesIO(response.content)).to_json('yellow_tripdata_2023-01.jsonl', orient='records', lines=True)
3 changes: 3 additions & 0 deletions examples/workspace/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyarrow
pandas
requests

0 comments on commit 0c8d07c

Please sign in to comment.