Claude-skill-registry-data managing-deployment
Deployment and infrastructure for the site. Consult when troubleshooting deployments, modifying CI/CD, or diagnosing build issues.
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/managing-deployment" ~/.claude/skills/majiayu000-claude-skill-registry-data-managing-deployment && rm -rf "$T"
data/managing-deployment/SKILL.mdManaging Deployment
Deployment and infrastructure maintenance for the site.
When to Use
Consult this skill when troubleshooting failed deployments, modifying the GitHub Actions workflow, or diagnosing build issues. The gcloud and GitHub MCP servers are available for direct Cloud Run and repository operations.
Architecture
Every push triggers deployment via GitHub Actions:
- main branch → Production (100% traffic)
- other branches → Preview (tagged revision, no traffic)
Key Files
| File | Purpose |
|---|---|
| CI/CD workflow |
| Multi-stage Docker build |
Pre-Deployment Verification
Before pushing, verify the build will succeed:
npm run check # TypeScript and Astro checks npm run lint # ESLint npm run build # Full production build
If
npm run build succeeds locally, the Docker build should succeed in CI.
Docker Build
Multi-stage build defined in
Dockerfile:
- Build stage: Installs all dependencies, runs
npm run build - Runtime stage: Production dependencies only, copies built output
Check the Dockerfile for current Node version and port configuration.
Diagnosing Build Failures
TypeScript Errors
npm run check
Fix all errors before pushing.
ESLint Errors
npm run lint --fix
Missing Dependencies
If build fails with module not found:
- Check the import path is correct
- Verify package is in
dependencies (not devDependencies if needed at runtime)package.json - Run
locally to verifynpm install
Astro Build Errors
Common causes:
- Invalid frontmatter in MDX files
- Missing required props in components
- Circular imports
Run
npm run build locally to see full error output.
Workflow Structure
The workflow in
.github/workflows/deploy.yml:
- Checkout code
- Determine if production or preview (branch name)
- Authenticate to Google Cloud
- Build and push Docker image to Artifact Registry
- Deploy to Cloud Run with appropriate traffic settings
Production vs Preview
Production (main branch):
- Receives 100% traffic immediately
- Replaces previous production revision
Preview (other branches):
- Tagged revision with no traffic
- Accessible via tag URL:
(service name from workflowhttps://{tag}---{service-name}-{hash}.run.app
section)env - Branch names are sanitised for Cloud Run (lowercase, alphanumeric + hyphens)
Cloud Run Configuration
Settings defined in
.github/workflows/deploy.yml:
- Region, service name, registry:
section at the top of the workflowenv - Memory, instances, port:
section in deploy stepsflags
When modifying deploy flags, keep production and preview steps in sync.
Required Secrets
GitHub repository secrets:
| Secret | Purpose |
|---|---|
| Google Cloud project ID |
| Service account JSON key |
If deployment fails with authentication errors, these secrets may need regenerating.
Checking Deployment Status
With gcloud MCP (
mcp__gcloud__run_gcloud_command):
— service status and URLgcloud run services describe
— list revisionsgcloud run revisions list
— view logsgcloud run services logs read
Region and service name are in the workflow's
env section.
With GitHub MCP:
— verify what's been pushedmcp__github__list_commits
withmcp__github__pull_request_read
— check PR CI stateget_status
Modifying the Workflow
When editing
.github/workflows/deploy.yml:
- Keep production and preview deploy steps in sync (same flags)
- Test workflow changes on a branch first (creates preview deployment)
- Validate YAML syntax before committing