From e199a41eca11071eaad5ad1a1dbaa6340cae6a9d Mon Sep 17 00:00:00 2001 From: marioseixas Date: Fri, 21 Jun 2024 23:50:23 -0300 Subject: [PATCH] Create datasette.yml --- .github/workflows/datasette.yml | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/datasette.yml diff --git a/.github/workflows/datasette.yml b/.github/workflows/datasette.yml new file mode 100644 index 0000000..55b12ea --- /dev/null +++ b/.github/workflows/datasette.yml @@ -0,0 +1,35 @@ +name: Build README and deploy Datasette + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install datasette openai-to-sqlite + + - name: Fetch markdown files and convert to SQLite + run: | + mkdir -p data + for file in $(find . -name "*.md"); do + openai-to-sqlite insert data/documents.db documents "$file" + done + + - name: Deploy to Datasette + run: datasette publish vercel data/documents.db --token ${{ secrets.VERCEL_TOKEN }}