The Go code which powers the Outs Above Average Monitor website.
Download the latest Baseball Savant snapshot and write it into data/oaamonitor.db:
go run ./cmd/fetch -database data/oaamonitor.dbPass -from-storage to pull the most recently uploaded SQLite file from object storage, or -upload to push the refreshed database (credentials are taken from the usual environment variables).
Once the SQLite database is up to date, render the static bundle (HTML, JSON, assets) to the target folder:
go run ./cmd/build -database data/oaamonitor.db -out publicThe builder renders every player and team page into the public/ directory, copies static assets, emits a search-index.json, and packages the SQLite database at public/downloads/oaamonitor.db.
GitHub Actions is wired to:
- Refresh the database on the cron schedule with
go run ./cmd/fetch -uploadand push it to S3-compatible storage (see.github/workflows/refresh.yml). - Deploy the static site to GitHub Pages on every push to
mainafter downloading the latest database from storage (see.github/workflows/deploy.yml).
Set these repository secrets so both workflows can authenticate against your storage bucket:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGIONAWS_ENDPOINT_URL_S3(optional; defaults tohttps://s3.amazonaws.com, override for other S3-compatible providers)
GitHub Pages handles the hosting; once the deploy workflow runs, the published site is available under the repository’s Pages URL (or any custom domain configured in the repo settings).