Requirements: Bun 1.3+, a Cloudflare Workers Paid account, a
Last.fm API key, and a GitHub personal
access token that can query the GraphQL API. Add read:user when private
contribution totals for the token owner should be included.
-
Install dependencies:
bun install
-
Log in and create the KV namespace:
bunx wrangler login bunx wrangler kv namespace create ACTIVITY_CACHE
-
Replace the existing
account_idand KV namespaceidinwrangler.jsoncwith the values for your Cloudflare account. -
Add both credentials as encrypted secrets:
bunx wrangler secret put LASTFM_API_KEY bunx wrangler secret put GITHUB_TOKEN
-
Deploy:
bun run deploy
GitHub Actions verifies and deploys every push to main. Add a repository
Actions secret named CLOUDFLARE_API_TOKEN containing a Cloudflare API token
with permission to deploy this Worker. The workflow can also be run manually
from GitHub's Actions page.
For local development, copy .dev.vars.example to .dev.vars, add the API
keys, and run bun run dev. Do not commit .dev.vars.