-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (58 loc) · 1.67 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
name: Deploy Datasette
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'docker/**'
- 'data/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
with:
lfs: true
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.2.2'
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Setup Babashka
uses: turtlequeue/setup-babashka@v1.6.0
with:
babashka-version: 1.3.190
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Cache db
id: cache-db
uses: actions/cache@v3
with:
path: ./data/data.db
key: cache-${{ hashFiles('input/**') }}-${{ hashFiles('scripts/**') }}
- name: Generate db
run: bb --main scripts.build-db
- uses: actions/cache@v2
with:
path: |
~/.npm
./app/node_modules
key: node-${{ hashFiles('./app/pnpm-lock.yaml') }}
- name: Install frontend dependencies
run: cd app && pnpm install --config.arch=x64 --config.platform=linux --config.libc=glibc
- name: Build frontend
run: |
cd app && pnpm exec tailwindcss -i ./styles/main.css -o ./dist/main.css --minify
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --detach
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}