Overview
This project deploys to Cloudflare Workers, a serverless platform that runs your code at the edge. The worker serves dynamically generated SVG images for your GitHub profile README.Prerequisites
Before deploying, ensure you have:- A Cloudflare account
- Node.js installed (version 20.8.1 or later)
- pnpm package manager installed
- Wrangler CLI configured
Wrangler Configuration
The project uses Wrangler to manage Cloudflare Workers deployments. The configuration is stored inwrangler.toml:
Configuration Options
- name: The name of your worker (appears in Cloudflare dashboard)
- main: Entry point for your worker code
- compatibility_date: Cloudflare Workers compatibility date
Local Development
Start the development server locally:wrangler dev and starts a local server where you can test your worker before deployment.
Deployment Process
Manual Deployment
To deploy manually from your local machine:- Generate the latest GitHub contribution stats:
- Deploy to Cloudflare Workers:
deploy script automatically runs pnpm stats before deploying to ensure your data is up-to-date.
Automated Deployment
The project uses GitHub Actions for automated deployments. See the Workflows page for details on automated deployments.Wrangler Authentication
For local deployments, you need to authenticate Wrangler with your Cloudflare account:Custom Domain Setup
Adding a Custom Domain
- Go to your Cloudflare Workers dashboard
- Select your worker
- Navigate to Settings > Triggers
- Under Custom Domains, click Add Custom Domain
- Enter your domain (e.g.,
aidre.svene.workers.devor your own domain) - Follow the DNS configuration instructions
Workers.dev Subdomain
By default, Cloudflare provides a*.workers.dev subdomain. You can customize this in the Cloudflare dashboard under your worker’s triggers.
Using Your Own Domain
If you have a domain managed by Cloudflare:- Ensure your domain is added to Cloudflare
- Add a custom domain in the Workers dashboard
- Cloudflare automatically configures the DNS records
Environment Variables
For production deployment, configure the required environment variables in your GitHub repository secrets. See Environment Variables for details.Deployment Verification
After deployment, verify your worker is running:Troubleshooting
Common Issues
Build Errors If you encounter TypeScript errors during deployment:wrangler.toml configuration is correct.
Next Steps
- Configure Environment Variables
- Set up GitHub Actions Workflows
- Customize your worker domain in the Cloudflare dashboard