Deploy stable-docs.datasette.io on publish

Refs https://github.com/simonw/datasette.io/issues/67
pull/1368/head
Simon Willison 2021-06-23 12:30:03 -07:00
rodzic a6c55afe8c
commit 7bc85b26d6
1 zmienionych plików z 42 dodań i 0 usunięć

Wyświetl plik

@ -29,6 +29,7 @@ jobs:
- name: Run tests
run: |
pytest
deploy:
runs-on: ubuntu-latest
needs: [test]
@ -55,6 +56,47 @@ jobs:
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
deploy_static_docs:
runs-on: ubuntu-latest
needs: [deploy]
# if: "!github.event.release.prerelease"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-publish-pip-
- name: Install dependencies
run: |
python -m pip install -e .[docs]
python -m pip install sphinx-to-sqlite==0.1a1
- 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: google-github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Deploy stable-docs.datasette.io to Cloud Run
run: |-
gcloud config set run/region us-central1
gcloud config set project datasette-222320
datasette publish cloudrun docs.db \
--service=datasette-docs-stable
deploy_docker:
runs-on: ubuntu-latest
needs: [deploy]