/docs-deploy - Deploy docs.coditect.ai
Automated build and deployment of the CODITECT documentation site to Cloud Run.
Usage
# Deploy with auto-generated version (v1.X.Y based on git)
/docs-deploy
# Deploy with specific version tag
/docs-deploy v1.6.0-feature-name
# Build only (no deploy)
/docs-deploy --build-only
# Deploy existing image (skip build)
/docs-deploy v1.5.0-workflows --deploy-only
# Dry run (show what would happen)
/docs-deploy --dry-run
# Project-scoped deployment (ADR-159)
/docs-deploy --project CUST-avivatec-fpa
System Prompt
EXECUTION DIRECTIVE:
When the user invokes /docs-deploy, execute the following workflow:
Step 1: Validate Environment
# Verify we're in the docs-site directory or can find it
DOCS_SITE="${DOCS_SITE:-$(git rev-parse --show-toplevel)/submodules/cloud/coditect-cloud-infra/docs-site}"
[ -d "$DOCS_SITE" ] || { echo "ERROR: docs-site not found"; exit 1; }
cd "$DOCS_SITE"
# Verify gcloud is configured
gcloud config get-value project 2>/dev/null | grep -q coditect-cloud-infra || {
echo "ERROR: gcloud not configured for coditect-cloud-infra"
exit 1
}
Step 2: Determine Version
# If no version provided, auto-generate from git
if [ -z "$VERSION" ]; then
# Get latest tag or use commit count
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v1.0.0")
COMMIT_COUNT=$(git rev-list --count HEAD)
VERSION="v1.${COMMIT_COUNT}.0-$(date +%Y%m%d)"
fi
echo "Version: $VERSION"
Step 3: Build & Deploy (using existing cloudbuild.yaml)
Cloudbuild Config: ~/PROJECTS/coditect-rollout-master/submodules/cloud/coditect-cloud-infra/docs-site/cloudbuild.yaml
# Build and deploy using cloudbuild.yaml (handles both steps)
gcloud builds submit \
--config ~/PROJECTS/coditect-rollout-master/submodules/cloud/coditect-cloud-infra/docs-site/cloudbuild.yaml \
--substitutions=_TAG=$VERSION \
--project coditect-cloud-infra
The cloudbuild.yaml includes:
- Docker build with E2_HIGHCPU_32 machine type
- Automatic push to Artifact Registry
- Cloud Run deployment with optimized settings (1 CPU, 512Mi RAM)
- Tags both
$VERSIONandlatest
Step 4: Deploy Only (for existing images)
# Deploy existing image (skip build) - only with --deploy-only
gcloud run deploy docs-coditect \
--image us-central1-docker.pkg.dev/coditect-cloud-infra/coditect-docs/docs-coditect:$VERSION \
--region us-central1 \
--project coditect-cloud-infra \
--allow-unauthenticated
Step 5: Verify
# Verify deployment
curl -sL -o /dev/null -w "%{http_code}" "https://docs.coditect.ai/" | grep -q 200 && \
echo "✅ Deployment verified: https://docs.coditect.ai" || \
echo "❌ Deployment verification failed"
Configuration
| Setting | Value |
|---|---|
| Project | coditect-cloud-infra |
| Region | us-central1 |
| Service | docs-coditect |
| Registry | us-central1-docker.pkg.dev/coditect-cloud-infra/coditect-docs |
| Cloudbuild YAML | ~/PROJECTS/coditect-rollout-master/submodules/cloud/coditect-cloud-infra/docs-site/cloudbuild.yaml |
| Machine Type | E2_HIGHCPU_32 (32 vCPUs for faster builds) |
| Timeout | 40 minutes |
Version Naming Convention
| Pattern | Example | Use Case |
|---|---|---|
vX.Y.Z | v1.5.0 | Semantic version release |
vX.Y.Z-feature | v1.5.0-workflows | Feature deployment |
vX.Y.Z-fix | v1.5.1-hotfix | Bug fix |
vX.Y.Z-YYYYMMDD | v1.123.0-20260109 | Auto-generated |
Examples
Standard Deployment
/docs-deploy v1.6.0-new-feature
Result: Builds image, deploys to Cloud Run, verifies at docs.coditect.ai
Quick Rebuild After Content Change
/docs-deploy v1.5.1-content-update
Test Build Without Deploy
/docs-deploy v1.6.0-test --build-only
Deploy Previously Built Image
/docs-deploy v1.5.0-workflows --deploy-only
Deployment History
Track deployments by listing Cloud Run revisions:
gcloud run revisions list --service docs-coditect --region us-central1 --project coditect-cloud-infra
Rollback
To rollback to a previous version:
gcloud run services update-traffic docs-coditect \
--to-revisions=docs-coditect-XXXXX-XXX=100 \
--region us-central1 \
--project coditect-cloud-infra
Troubleshooting
| Issue | Solution |
|---|---|
| Build timeout | Increase --timeout or use larger machine type |
| Memory error | Add NODE_OPTIONS="--max-old-space-size=8192" to Dockerfile |
| Permission denied | Run gcloud auth login and verify IAM roles |
| Image not found | Check registry path and version tag |
Related
- /docs-transform - Transform components to docs
- /workflow-to-docs - Generate workflow documentation
- PILOT Plan F.8 - Documentation track
Script Location: Inline (no external script required)
Cloud Build Config: docs-site/cloudbuild.yaml (optional)
Last Deployed: v1.5.0-workflows (Jan 9, 2026)