Why Automated Rebuilds?
Your portfolio is a static site that fetches dynamic content during the build process. Without automated rebuilds:- New tracks won’t appear until you manually trigger a build
- Upcoming events won’t update
- Video playlists remain static
- Metrics like follower counts become outdated
The portfolio already has a GitHub Actions workflow configured at
.github/workflows/rebuild.yml. This guide explains how it works and how to customize it.How It Works
The automated rebuild system uses two components:- GitHub Actions: A cron job that runs on a schedule
- Vercel Deploy Hook: A webhook URL that triggers a new deployment
Setting Up Automated Rebuilds
Create a Vercel Deploy Hook
Deploy Hooks are unique URLs that trigger a deployment when called.
- Go to your project in the Vercel Dashboard
- Navigate to Settings → Git
- Scroll to Deploy Hooks
- Enter a name (e.g., “Weekly Rebuild”)
- Select the branch to deploy (usually
mainormaster) - Click Create Hook
- Copy the generated webhook URL
Add Deploy Hook to GitHub Secrets
Store the webhook URL securely in GitHub:
- Go to your GitHub repository
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
VERCEL_DEPLOY_HOOK - Value: Paste the webhook URL from Vercel
- Click Add secret
Verify the Workflow File
Your repository should already have This workflow:
.github/workflows/rebuild.yml. Let’s review it:- Runs every Monday at 8:00 AM UTC (rebuild.yml:6)
- Can be manually triggered via GitHub Actions UI (rebuild.yml:7)
- Makes a POST request to your Vercel Deploy Hook (rebuild.yml:14)
Test the Workflow
Before waiting a week, test that everything works:
- Go to your GitHub repository
- Click Actions tab
- Select Reconstrucción Semanal workflow
- Click Run workflow dropdown
- Click the green Run workflow button
- Watch the workflow execute in real-time
- Verify a new deployment appears in Vercel
The workflow should complete in a few seconds. The actual build happens in Vercel and takes 1-2 minutes.
Customizing the Schedule
The default schedule is every Monday at 8:00 AM UTC. You can customize this using cron syntax.Cron Syntax
Common Schedules
| Description | Cron Expression | Use Case |
|---|---|---|
| Every Monday at 8 AM UTC | 0 8 * * 1 | Weekly updates (default) |
| Every day at midnight UTC | 0 0 * * * | Daily fresh content |
| Twice weekly (Mon & Thu) | 0 8 * * 1,4 | More frequent updates |
| First day of month | 0 0 1 * * | Monthly rebuild |
| Every Sunday at 6 AM UTC | 0 6 * * 0 | Weekend preparation |
Use crontab.guru to generate and validate cron expressions. GitHub Actions uses UTC timezone.
Example: Daily Rebuilds
To rebuild every day at midnight UTC:Advanced Configuration
Multiple Deploy Hooks
If you have staging and production environments:Conditional Rebuilds
Rebuild only if new content exists (requires API checks):Notifications
Get notified when rebuilds complete:Monitoring Automated Builds
GitHub Actions Dashboard
- Go to your repository’s Actions tab
- View all workflow runs with timestamps
- Click any run to see detailed logs
- Check for failures and debug issues
Vercel Deployments
- Open your Vercel Dashboard
- Click on your project
- View all deployments with:
- Trigger source (GitHub Actions hook)
- Build duration
- Build logs
- Deployment preview
Deployments triggered by the Deploy Hook will show “Deploy Hook” as the source in Vercel, making them easy to identify.
Troubleshooting
Workflow Not Running
Symptom: No builds are triggered automatically Solutions:- Verify the cron schedule is correct
- Check that GitHub Actions are enabled for your repository
- Ensure the workflow file is on the default branch (
mainormaster) - GitHub Actions may have a delay of up to 5 minutes
Deploy Hook Fails
Symptom: Workflow runs but Vercel doesn’t build Solutions:- Verify
VERCEL_DEPLOY_HOOKsecret is set correctly - Check the webhook URL is still valid in Vercel settings
- Ensure the secret has no extra spaces or characters
- Regenerate the Deploy Hook in Vercel if needed
Build Succeeds But Content Not Updated
Symptom: Deployment completes but shows old content Possible causes:- Browser cache: Hard refresh with
Ctrl+Shift+R(Windows) orCmd+Shift+R(Mac) - CDN cache: Vercel CDN cache may take a few minutes to invalidate
- API rate limits: Check Vercel function logs for API errors
- Stale cache: The server-side cache resets with each build, so this shouldn’t be an issue
GitHub Actions Quota
Symptom: Workflow disabled due to quota Solution: GitHub provides 2,000 free Action minutes per month for private repos (unlimited for public repos). This workflow uses less than 1 minute per run, so quota shouldn’t be an issue unless you run it very frequently.Best Practices
- Start with weekly rebuilds: Daily rebuilds may be overkill unless you publish content very frequently
-
Use manual triggers for testing: Always test the workflow with
workflow_dispatchbefore relying on cron - Monitor build times: If builds take too long, consider optimizing API calls or caching strategies
- Check API quotas: Ensure your weekly rebuilds don’t exceed API rate limits (especially YouTube Data API)
- Version your workflow: Commit changes to the workflow file with clear messages explaining schedule changes
- Set up notifications: Add Slack or email notifications for failed workflows so you know immediately if something breaks
Cost Considerations
GitHub Actions
- Public repos: Unlimited free minutes
- Private repos: 2,000 free minutes per month
- This workflow uses: ~0.5 minutes per run
- Weekly cost: ~2 minutes per month (essentially free)
Vercel
- Free tier: 100 deployments per day
- This workflow adds: 4-5 deployments per month
- Impact: Negligible on free tier quota
Both GitHub Actions and Vercel’s free tiers are more than sufficient for automated weekly rebuilds. You won’t incur any costs.
Alternative CI/CD Platforms
While GitHub Actions is the default choice, you can also use:GitLab CI
Vercel Cron Jobs (Coming Soon)
Vercel is developing native cron job support that won’t require GitHub Actions.External Cron Services
Use services like cron-job.org or EasyCron:- Create an account
- Add a new cron job
- Set URL to your Vercel Deploy Hook
- Configure schedule
- Set method to POST
Next Steps
Your portfolio is now fully automated! Consider:- Monitoring Vercel Analytics to see how users engage with fresh content
- Adding more API integrations to showcase additional platforms
- Creating a custom rebuild notification system
- Documenting your schedule for future reference