-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (39 loc) · 1.25 KB
/
publish_db.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
name: Generate and Publish Database
on:
schedule:
- cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
workflow_dispatch:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Download XML zip file
run: |
curl -O http://ratings.fide.com/download/players_list_xml.zip
- name: Unzip XML file
run: |
unzip players_list_xml.zip -d ./
mv players_list_xml_foa.xml players.xml
- name: Generate SQLite database
run: |
python players.py players.xml players.db
- name: Generate metadata.json
run: |
python generate_metadata.py
- name: Install Flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io using Datasette
run: |
datasette publish fly players.db --app="fide-players" -m metadata.json --install=datasette-plot