This project uses GitHub Actions to automatically capture market data every 5 minutes during market hours (9:15 AM - 3:30 PM IST, Monday-Friday).
First, deploy your app to Vercel:
# Remove cron from vercel.json (already done)
vercel --prodAfter deployment, note your Vercel URL (e.g., https://trading-website.vercel.app)
# Create a new repository on GitHub (https://github.com/new)
# Then push your code:
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git branch -M main
git push -u origin main- Go to your GitHub repository
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Add these secrets:
| Secret Name | Value |
|---|---|
VERCEL_URL |
Your Vercel deployment URL (e.g., https://trading-website.vercel.app) |
CRON_SECRET |
Same value as in your .env.local |
- Go to Actions tab in your repository
- Click "I understand my workflows, go ahead and enable them"
- The workflow will start running automatically!
- Go to Actions tab
- Click on "Capture Market Data" workflow
- You should see runs every 5 minutes during market hours
- Click on a run to see the logs
- Check your Supabase dashboard to verify data is being saved
You can manually trigger the workflow:
- Go to Actions tab
- Click "Capture Market Data"
- Click "Run workflow"
- Click the green "Run workflow" button
The workflow runs:
- Every 5 minutes from 9:15 AM to 3:30 PM IST
- Monday to Friday only
- Automatically converts IST to UTC for GitHub Actions
- Check Actions tab for workflow runs
- Each run shows success/failure status
- Click on a run to see detailed logs
- Failures will be highlighted in red
✅ Completely FREE!
- GitHub Actions provides 2,000 free minutes/month
- This workflow uses ~1 minute per day
- Well within free tier limits
Workflow not running:
- Check that GitHub Actions is enabled in repository settings
- Verify secrets are added correctly
- Check the Actions tab for any error messages
401 Unauthorized error:
- Verify
CRON_SECRETmatches your.env.local - Check
VERCEL_URLis correct (no trailing slash)
No data in Supabase:
- Check Vercel deployment logs
- Verify Supabase environment variables are set in Vercel
- Test the endpoint manually:
./test-cron.sh
If you upgrade to Vercel Pro ($20/month), you can use Vercel's built-in cron instead:
- Uncomment the
cronssection invercel.json - Redeploy to Vercel
- Disable GitHub Actions workflow
🎉 Your automated data capture is now running on GitHub Actions!