how-to-talk-to-claude/README-DEPLOYMENT.md
Claude AI Guide Project 262c0d5d58
Some checks failed
Build and Deploy / build (push) Has been cancelled
Build and Deploy / deploy (push) Has been cancelled
🚀 Complete CI/CD pipeline for automated deployments
GitHub Actions Workflows:
- test.yml: PR validation with Docker build and health checks
- deploy.yml: Automated build and deployment on master push
- Multi-platform builds (amd64, arm64) with registry caching
- SSH-based deployment with zero-downtime updates

Production Infrastructure:
- docker-compose.prod.yml: Production deployment configuration
- deploy.sh: Automated deployment script with health checks
- .env.production: Production environment template
- README-DEPLOYMENT.md: Complete deployment documentation

Features:
- Automated testing on pull requests
- Container registry publishing to GHCR
- Health check validation
- Image cleanup and optimization
- Proper security with read-only containers

Ready for automated deployments to claude.supported.systems\!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 03:46:27 -06:00

96 lines
2.3 KiB
Markdown

# Deployment Guide
## CI/CD Pipeline Overview
This repository includes automated CI/CD for building and deploying the "How to Talk to Claude" guide.
### Workflows
#### 1. Test Build (`.github/workflows/test.yml`)
- **Trigger**: Pull requests to `master`
- **Purpose**: Validate Docker builds and basic functionality
- **Tests**: Docker build, container startup, health checks
#### 2. Build and Deploy (`.github/workflows/deploy.yml`)
- **Trigger**: Pushes to `master` branch
- **Purpose**: Build multi-arch images and deploy to production
- **Features**:
- Multi-platform builds (amd64, arm64)
- Container registry publishing
- Automated deployment via SSH
### Setup Requirements
#### Repository Secrets
Configure these secrets in your Git repository:
```bash
DEPLOY_HOST=your-server.com
DEPLOY_USER=deployment-user
DEPLOY_KEY=-----BEGIN OPENSSH PRIVATE KEY-----...
GITHUB_TOKEN=automatically-provided
```
#### Server Setup
On your deployment server:
1. **Install Docker and Docker Compose**
2. **Create deployment directory**:
```bash
mkdir -p /opt/how-to-claude
cd /opt/how-to-claude
```
3. **Copy production files**:
```bash
# Copy docker-compose.prod.yml and .env.production
# Update .env.production with actual values
```
4. **Ensure Caddy network exists**:
```bash
docker network create caddy
```
### Manual Deployment
For manual deployment:
```bash
# Local build and test
docker build -t how-to-claude:latest .
docker run -p 8080:80 how-to-claude:latest
# Production deployment
./deploy.sh
```
### Environment Files
- `.env.example` - Template for local development
- `.env.production` - Production environment variables
- `docker-compose.yml` - Local development
- `docker-compose.prod.yml` - Production deployment
### Monitoring
The deployment includes:
- **Health checks** at `/health` endpoint
- **Container restart policies**
- **Image cleanup** after deployment
### Troubleshooting
**Build fails:**
- Check Astro build logs in CI
- Verify production config resolves plugin conflicts
**Deployment fails:**
- Verify SSH access and Docker permissions
- Check server disk space and network connectivity
- Review container logs: `docker logs how-to-claude`
**Site not accessible:**
- Verify Caddy network configuration
- Check domain DNS settings
- Test health endpoint: `curl http://localhost:80/health`