Skip to content

Commit 6cdc4e3

Browse files
committed
Add static site generator for dataset browsing
- Added dark-themed static site with dataset pages - Parse markdown documentation and frontmatter (YAML) - Display column information and data samples (first 10 rows) - Show example queries from markdown frontmatter - Generate individual pages for each dataset with CSV/JSON/Parquet links - Updated GitHub Actions to deploy site to GitHub Pages - Added dependencies: markdown and pyyaml - Fixed input directory to point to queries/ folder
1 parent e796c45 commit 6cdc4e3

File tree

3 files changed

+490
-3
lines changed

3 files changed

+490
-3
lines changed

.github/workflows/datasets.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ on:
99
- main
1010
workflow_dispatch: # Allow manual trigger
1111

12+
# Allow GitHub Actions to deploy to Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
1223
jobs:
1324
generate-datasets:
1425
runs-on: ubuntu-latest
@@ -37,7 +48,7 @@ jobs:
3748
- name: Run sql2csv
3849
run: |
3950
sql2csv \
40-
--input-sql-dir ${{ github.workspace }} \
51+
--input-sql-dir ${{ github.workspace }}/queries \
4152
--output-dir /tmp/output \
4253
--pgsql-creds-file /tmp/creds/.pgpass \
4354
--aws-creds-file /tmp/creds/.aws-creds
@@ -46,3 +57,15 @@ jobs:
4657
if: always()
4758
run: |
4859
rm -rf /tmp/creds
60+
61+
- name: Setup Pages
62+
uses: actions/configure-pages@v4
63+
64+
- name: Upload site artifact
65+
uses: actions/upload-pages-artifact@v3
66+
with:
67+
path: '/tmp/output/site'
68+
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

sql2datasets/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers = [
1818
"Topic :: Database",
1919
"Topic :: Utilities",
2020
]
21-
dependencies = ["boto3", "python-dotenv", "psycopg2-binary", "pandas", "pyarrow"]
21+
dependencies = ["boto3", "python-dotenv", "psycopg2-binary", "pandas", "pyarrow", "markdown", "pyyaml"]
2222
readme = "README.md"
2323

2424
[project.scripts]

0 commit comments

Comments
 (0)