-
Notifications
You must be signed in to change notification settings - Fork 83
71 lines (69 loc) · 2.09 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build README and deploy Datasette
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
# We need full history to introspect created/updated:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Download previous database
run: curl -o til.db https://til.simonwillison.net/til.db
- name: Build database
run: python build_database.py
- name: Soundness check
run: |-
datasette . --get / | grep "Simon Willison: TIL"
- name: Update README
run: |-
python update_readme.py --rewrite
cat README.md
- name: Commit and push if README changed
run: |-
git diff
git config --global user.email "readme-bot@example.com"
git config --global user.name "README-bot"
git diff --quiet || (git add README.md && git commit -m "Updated README")
git push
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Deploy Datasette using Zeit Now
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
run: |-
datasette publish now til.db \
--token $NOW_TOKEN \
--branch main \
--project simon-til \
--metadata metadata.yaml \
--install datasette-template-sql \
--install datasette-atom~=0.6 \
--install datasette-json-html \
--install beautifulsoup4 \
--install datasette-debug-asgi \
--install "datasette-graphql>=0.12" \
--plugins-dir plugins \
--template-dir templates \
--public