From c37a0a93ecb847e66cfe7b6f9452ba210fcae91b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 18 Oct 2020 14:35:26 -0700 Subject: [PATCH] Build and deploy docs.db to datasette-docs-latest --- .github/workflows/deploy-latest.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/deploy-latest.yml b/.github/workflows/deploy-latest.yml index 55aabb76..10130253 100644 --- a/.github/workflows/deploy-latest.yml +++ b/.github/workflows/deploy-latest.yml @@ -26,10 +26,18 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e .[test] + python -m pip install -e .[docs] + python -m pip install sphinx-to-sqlite - name: Run tests run: pytest - name: Build fixtures.db run: python tests/fixtures.py fixtures.db fixtures.json + - name: Build docs.db + run: |- + cd docs + sphinx-build -b xml . _build + sphinx-to-sqlite ../docs.db _build + cd .. - name: Set up Cloud Run uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: @@ -46,3 +54,9 @@ jobs: --version-note=$GITHUB_SHA \ --extra-options="--config template_debug:1" \ --service=datasette-latest + # Deploy docs.db to a different service + datasette publish cloudrun docs.db \ + --branch=$GITHUB_SHA \ + --version-note=$GITHUB_SHA \ + --extra-options="--config template_debug:1" \ + --service=datasette-docs-latest