-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (78 loc) · 2.62 KB
/
deploy.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Deploy
"on":
workflow_dispatch:
push:
branches:
- "main"
schedule:
- cron: "0 13 * * *" # Every day at 1pm UTC
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- id: checkout
name: "Checkout 🛎"
uses: actions/checkout@v2
- id: setup-python
name: "Setup Python ${{ matrix.python-version }} 🏗"
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- id: setup-poetry
name: "Setup Poetry 📝"
run: |
curl -sSL https://install.python-poetry.org | python3 -
- id: get-cache-poetry-directory
name: "Get poetry's cache directory 🔎"
run: |
echo "::set-output name=dir::$(poetry config cache-dir)"
- id: cache-poetry-directory
name: "Cache poetry 📦"
uses: actions/cache@v3.0.11
with:
path: ${{ steps.get-cache-poetry-directory.outputs.dir }}
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- id: install-dependencies
name: "Install dependencies 👨🏻💻"
run: make setup
- id: cache-database
name: "Cache dinesafe.db 📦"
uses: actions/cache@v3.0.11
with:
path: dinesafe.db
key: dinesafe-db
- id: build-database
name: "Build the database 🗂️"
run: make build
- id: deploy
name: "Deploy datasets to Vercel 🚀"
env:
VERCEL_PROJECT: ${{ secrets.VERCEL_PROJECT }}
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |-
poetry run datasette publish vercel dinesafe.db \
--metadata metadata.json \
--token $VERCEL_TOKEN \
--project $VERCEL_PROJECT \
--scope $VERCEL_SCOPE \
--install datasette-sentry \
--install datasette-block-robots \
--install datasette-dashboards \
--install datasette-gzip
- id: sentry-release
name: "✍️ Create a release in Sentry"
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG_NAME }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
ignore_empty: true
- id: sentry-check-out
name: "⏲️ Send Heartbeat"
run: |-
curl -X POST \
"https://betteruptime.com/api/v1/heartbeat/LqXrgg8oFkAtGhaHj731wgGf"