Engineering Decisions: CI/CD Pipeline and Blog Automation Setup
Weekly technical decisions including GitHub Actions deployment pipeline, OpenRouter integration, and automated content generation workflow.
This week's engineering work focused on establishing automated deployment pipelines and content generation infrastructure. The primary decisions centered around GitHub Actions configuration, Vercel deployment strategies, and OpenRouter API integration for blog automation.
CI/CD Pipeline Architecture
We implemented three distinct GitHub Actions workflows to handle different deployment scenarios. The CI workflow runs on every pull request and push to main or stage branches, executing npm ci and npm run build to validate build integrity. This provides immediate feedback on code changes before they reach production.
The CD workflow handles actual deployments with branch-based environment targeting. Pushes to the stage branch trigger preview deployments on Vercel, while main branch pushes deploy directly to production. This separation allows testing in a staging environment that mirrors production configuration.
- Stage branch deploys to Vercel preview environment for pre-production testing
- Main branch deploys directly to Vercel production
- Manual dispatch option available for emergency deployments
- Required secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID
Blog Automation Implementation
The weekly blog automation workflow runs every Monday at 13:00 UTC and integrates with OpenRouter's API. The system generates drafts by analyzing recent git commits, changed files, and repository context. This approach ensures blog content remains technically accurate and grounded in actual development work.
The automation pipeline consists of two Node.js scripts: generate-draft.mjs pulls repository context and calls OpenRouter to create draft JSON files, while publish-draft.mjs validates schema compliance and appends content to posts.json. Drafts are archived in content/blog/drafts/published/ after publication for audit purposes.
- OpenRouter model configurable via OPENROUTER_MODEL environment variable
- Draft generation pulls last 20 commits and recent file changes
- Schema validation ensures consistent JSON structure before publication
- Published content stored in content/blog/posts.json for static generation
API Route Updates and Contact Form
The app/api/contact/route.ts endpoint received multiple updates this week, indicated by frequent commits. This suggests iterative refinement of the contact form submission handling, likely addressing edge cases or improving error handling based on testing feedback.
The repeated 'go' commit messages throughout June 13 indicate rapid iteration cycles, possibly debugging deployment issues or fine-tuning the CI/CD pipeline configuration. The cd.yml update specifically suggests adjustments to the deployment workflow, potentially addressing staging environment configuration or Vercel integration parameters.
- Engineering
- CI/CD
- Automation
