Skip to content

Commit

Permalink
Workflow to deploy demo, refs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 23, 2020
1 parent f5daaba commit 614cfb3
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy demo

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
name: Configure HTTP download caching
with:
path: ~/data
key: ${{ runner.os }}-http-download-cache
- name: Install Python dependencies
run: pip install sqlite-utils datasette datasette-publish-vercel conditional-get
- name: Download database
run: |-
mkdir -p ~/data
conditional-get \
--etags ~/data/etags.json \
--output ~/data/favicons.db \
'https://static.simonwillison.net/static/2020/datasette-render-images-favicons.db'
- name: Create Metadata
run: |-
echo '{
"source": "datasette-render-images",
"source_url": "https://github.com/simonw/datasette-render-images",
"title": "datasette-render-images demo"
}' > metadata.json
- name: Deploy to Vercel
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
run: |-
datasette publish vercel ~/data/favicons.db \
-m metadata.json \
--alias datasette-json-html-demo.datasette.io \
--install=https://github.com/simonw/datasette-render-images/archive/$GITHUB_SHA.zip \
--service datasette-json-html-demo

0 comments on commit 614cfb3

Please sign in to comment.