2.5 KiB
2.5 KiB
GitHub Actions Deployment Setup
Required Secrets
Configure the following secrets in your GitHub repository settings:
Production Deployment Secrets
-
HOST - Your server IP address or domain
123.456.789.123 -
USERNAME - SSH username (usually
rootorubuntu)root -
SSH_KEY - Private SSH key for server access
-----BEGIN OPENSSH PRIVATE KEY----- your_private_key_content_here -----END OPENSSH PRIVATE KEY----- -
PORT - SSH port (optional, defaults to 22)
22
Server Prerequisites
Your production server should have:
-
Docker & Docker Compose installed
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh sudo usermod -aG docker $USER -
Project directory prepared
sudo mkdir -p /opt/quixotic sudo chown $USER:$USER /opt/quixotic cd /opt/quixotic git clone https://github.com/yourusername/quixotic.git . -
Environment file configured
# Create and configure .env.docker with your production values # The docker-compose.yml already references this file cp .env.docker.example .env.docker nano .env.docker
Workflow Features
CI Pipeline (ci.yml)
- ✅ Test & Lint - Runs on all PRs and pushes
- ✅ Multi-platform build - AMD64 and ARM64 support
- ✅ Docker image caching - Faster builds
- ✅ Auto-deployment - Deploys main branch to production
- ✅ Zero-downtime deployment - Rolling updates
Security Pipeline (security.yml)
- ✅ Dependency scanning - npm audit for vulnerabilities
- ✅ Code analysis - GitHub CodeQL for security issues
- ✅ Docker scanning - Trivy for container vulnerabilities
- ✅ Weekly scans - Automated security checks
Usage
-
Development workflow:
- Create feature branch:
git checkout -b feature/new-feature - Push changes: CI runs tests automatically
- Create PR: Full CI pipeline runs
- Create feature branch:
-
Production deployment:
- Merge to main: Automatic build and deploy
- Monitor deployment: Check GitHub Actions tab
-
Manual deployment:
# On server cd /opt/quixotic git pull origin main docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --pull always
Monitoring
- GitHub Actions - Build and deployment status
- Traefik Dashboard -
http://yourserver:8080 - Application Health -
https://yourdomain.com/health - Docker Logs -
docker-compose logs -f quixotic-app