This repository uses GitHub Actions to automatically build and deploy the application to Cloudflare whenever changes are pushed to the main branch.
To make the GitHub Actions workflow function correctly, you need to add the following secrets to your GitHub repository:
CLOUDFLARE_API_TOKEN- Your Cloudflare API token with Workers and D1 accessCLOUDFLARE_ACCOUNT_ID- Your Cloudflare account IDCLOUDFLARE_DATABASE_ID- The ID of your D1 database in CloudflareDATABASE_URL- The database URL for local development (not used in production)
- Go to your GitHub repository
- Click on "Settings" tab
- In the left sidebar, click on "Secrets and variables" > "Actions"
- Click on "New repository secret"
- Add each of the required secrets mentioned above
The workflow is configured to:
- Run whenever changes are pushed to the main or master branch
- Set up Bun and install dependencies
- Create necessary configuration files for Cloudflare deployment
- Build and deploy the application to Cloudflare
You can also manually trigger the deployment from the GitHub Actions tab using the "workflow_dispatch" event.
To test the deployment locally before pushing to GitHub, run:
cd madar-app
bun run cf-deployMake sure you have the required environment variables set in your local environment.