Add copy of Apache 2 license #164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy demo | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: actions/cache@v2 | |
name: Configure pip caching | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Download database | |
run: | | |
curl -O https://github-to-sqlite.dogsheep.net/github.db | |
- name: Install Python dependencies | |
run: | | |
pip install -e .[test] | |
- name: Generate fixtures.db | |
run: | | |
python tests/fixtures.py fixtures.db | |
- name: Create Metadata | |
run: | | |
echo '{ | |
"title": "datasette-graphql demo", | |
"about": "simonw/datasette-graphql", | |
"about_url": "https://github.com/simonw/datasette-graphql", | |
"description_html": "Try it out at <a href=\"/graphql\">/graphql</a>", | |
"databases": { | |
"fixtures": { | |
"tables": { | |
"repos": { | |
"plugins": { | |
"datasette-graphql": { | |
"json_columns": ["tags"] | |
} | |
} | |
} | |
} | |
} | |
} | |
}' > metadata.json | |
- name: Set up Cloud Run | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
version: '318.0.0' | |
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
- name: Deploy to Cloud Run | |
run: |- | |
gcloud config set run/region us-central1 | |
gcloud config set project datasette-222320 | |
datasette publish cloudrun github.db fixtures.db \ | |
-m metadata.json \ | |
--install=https://github.com/simonw/datasette-graphql/archive/$GITHUB_SHA.zip \ | |
--install=datasette-schema-versions \ | |
--service datasette-graphql-demo |