Run steam-to-sqlite #26820
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run steam-to-sqlite | |
on: | |
schedule: | |
- cron: "19 * * * *" # every hour | |
# Allows running this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install | |
run: | | |
pip install -r requirements.txt | |
pip install . | |
- name: run the script | |
run: | | |
wget -qO database.db https://www.dropbox.com/s/i47qt3chrp9lr9e/database.db?dl=1 | |
alembic upgrade head | |
python steam2sqlite/main.py --limit 45 | |
shell: bash | |
- name: upload to dropbox | |
run: | | |
python scripts/uploader.py database.db /database.db | |
env: | |
DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }} | |
shell: bash | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: database.db | |
path: database.db | |
- name: Get flyctl | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Deploy Datasette using Fly | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
run: |- | |
datasette publish fly database.db \ | |
--install datasette-graphql --install datasette-vega \ | |
--app steam-to-sqlite \ | |
--metadata datasette-data/metadata.json \ | |
--setting sql_time_limit_ms 3500 |