Commit Graph

34 Commits

Author SHA1 Message Date
Greg
7ce84142e9 Fix auto-promotion permissions
- Add 'contents: write' and 'actions: write' permissions to auto-promote workflow
- This should fix the 'Resource not accessible by integration' error
- Update to v2.0.3 to test the fixed auto-promotion pipeline

The auto-promotion workflow needs write permissions to merge branches
and trigger other workflows in the repository.
2025-07-01 14:19:45 -07:00
Greg
a509e4603e Remove custom domain testing from workflows
- Remove all custom domain SSL testing and health checks
- Use only canonical Knative domains for all testing
- Update all workflows to use domain secrets for health checks
- Remove kubectl dependencies from deployment workflows
- Update index.html to v2.0.2 for testing canonical domain workflow
- Simplify smoke tests to focus on Knative canonical domains only
- Clean up auto-promotion summaries to remove SSL references

All workflows now test only the canonical Knative domains and avoid
custom domain complexity for a cleaner, more reliable pipeline.
2025-07-01 12:42:05 -07:00
Greg
573587a45a feat: Update to Knative 2048 v2.0.1
- Update page title to reflect version and auto-deploy pipeline
- This will trigger the complete dev → staging → prod auto-promotion flow
2025-07-01 12:24:10 -07:00
Greg
8dda1e692b fix: Update workflows to use environment-specific domain secrets
- Add DEV_DOMAIN, STAGING_DOMAIN, PROD_DOMAIN secrets
- Update health check URLs to use correct environment subdomains:
  - Dev: game-2048-dev.game-2048-dev.dev.wa.darknex.us
  - Staging: game-2048-staging.game-2048-staging.staging.wa.darknex.us
  - Prod: game-2048-prod.game-2048-prod.wa.darknex.us
- This should fix the health check failures in workflows
2025-07-01 12:21:49 -07:00
Greg
57670b648c feat: Update page title to celebrate webhook-powered deployment
This change should trigger the automatic deployment pipeline to test
the complete dev -> staging -> prod auto-promotion workflow
2025-07-01 12:13:18 -07:00
Greg
524f44b023 fix: Configure webhook handler to use in-cluster service account
- Remove kubeconfig file mounting to use in-cluster service account
- Remove Docker socket mount (not needed for Knative deployments)
- Fix Kubernetes API connectivity issues
- Webhook deployment now working successfully with proper RBAC
2025-07-01 12:11:50 -07:00
Greg
6f57651f92 fix: Update webhook handler to skip Docker commands and map environment names
- Remove Docker pull step (Knative handles image pulling)
- Add environment name mapping (development -> dev, production -> prod)
- Add test files to .gitignore to exclude PII
- Webhook signature validation now working correctly
2025-07-01 12:03:23 -07:00
Greg
4a1ee54c6f fix: Use compact JSON payload to avoid signature validation issues
- Removed indentation/whitespace from JSON payload in workflow
- Should fix HMAC signature mismatch with webhook handler
- Webhook secrets are now synchronized between GitHub and cluster
2025-07-01 11:24:37 -07:00
Greg
b3f0fa3746 fix: Use hex encoding for webhook signature instead of base64
- Webhook handler expects hexdigest() format
- Deploy workflow was using base64 encoding
- This fixes the 401 signature validation error
2025-07-01 11:14:00 -07:00
Greg
23d3032ed6 fix: Add develop branch trigger to deploy-dev workflow
- Deploy to Development now triggers on develop branch pushes
- This enables the auto-promotion pipeline to work correctly
- Also fixed webhook ingress to use nginx class
2025-07-01 11:07:37 -07:00
Greg
f85048467f test: Trigger full auto-promotion pipeline
- Testing develop → dev → staging → production flow
- Verifying webhook deployments work end-to-end
- Using new GH_TOKEN with proper GHCR permissions
2025-07-01 11:00:51 -07:00
Greg
861832497d fix: Update GitHub Actions to use GH_TOKEN for container registry access
- Switch from GITHUB_TOKEN to GH_TOKEN for GHCR authentication
- This resolves 'installation not allowed to Write organization package' error
- All repository secrets have been configured via gh CLI
2025-07-01 10:50:05 -07:00
Greg
db01a880a7 feat: Improve tile spacing to prevent overlapping
- Increase margin between grid cells from 15px to 18px
- Update JavaScript positioning to match new spacing (124.25px)
- Increase game container size from 500px to 512px to accommodate larger grid
- Fix visual issue where tiles appeared too close together
2025-07-01 10:42:46 -07:00
Greg
a419767e89 feat: Remove manual approval gates for fully automated deployment pipeline 2025-07-01 10:38:23 -07:00
Greg
653353698f 🚀 Test deployment pipeline - Update to v2.0
- Add deployment test documentation
- Update game title to v2.0 to trigger pipeline
- Ready for end-to-end webhook deployment test
2025-07-01 10:20:56 -07:00
Greg
d582108b16 🔒 Add environment-based configuration system
- Add .env.example template with all configurable values
- Create comprehensive .gitignore for personal data
- Add sanitization script to remove hardcoded personal info
- Add environment-aware deployment scripts
- Add ENVIRONMENT.md documentation
- Keep personal information in .env (gitignored)

This makes the repository safe for public sharing while keeping personal domains, emails, and secrets secure.
2025-07-01 10:09:14 -07:00
Greg
63b53dfc1b feat: Implement webhook-based deployment for k3s behind NAT
- Replace SSH/kubectl deployment with secure webhook-based approach
- Add comprehensive webhook handler with HMAC signature verification
- Support blue-green deployment strategy for production
- Implement auto-promotion pipeline: dev → staging → prod
- Add health checks using canonical Knative domains only
- Include complete deployment documentation and setup scripts

Changes:
- Updated deploy-dev.yml, deploy-staging.yml, deploy-prod.yml workflows
- Added webhook handler Python script with Flask API
- Created Kubernetes manifests for webhook system deployment
- Added ingress and service configuration for external access
- Created setup script for automated webhook system installation
- Documented complete webhook-based deployment guide

Perfect for k3s clusters behind NAT without direct API access.
2025-06-30 23:41:53 -07:00
Greg
78261efab2 Merge branch 'main' into develop 2025-06-30 23:25:16 -07:00
Greg
938cd6e5a4 fix: Remove mixed uses/run keys and duplicated steps in deploy-dev.yml
- Fixed 'Run smoke test' step that had both 'uses' and 'run' keys
- Removed all duplicated deployment sections and jobs
- Added service manifest application before patching
- Simplified workflow to focus on core deployment functionality
- Removed duplicated kubectl setup and Playwright testing sections
- This should resolve the GitHub Actions validation errors for dev deployment
2025-06-30 23:24:27 -07:00
Greg
fb69897211 fix: Ensure Knative service exists before patching in staging deployment
- Apply service manifest before attempting to patch
- This prevents 'resource not found' errors when staging service doesn't exist yet
- Ensures proper deployment flow for staging environment
2025-06-30 23:22:30 -07:00
Greg
f08caeea49 fix: Remove duplicated steps and mixed uses/run keys in deploy-staging.yml
- Removed duplicated Docker build steps
- Removed conflicting kubectl setup
- Removed duplicated deployment sections
- Fixed step that had both 'uses' and 'run' keys
- Simplified staging workflow to focus on core deployment
- This should resolve the GitHub Actions validation errors
2025-06-30 23:20:26 -07:00
Greg
09ec016b6a feat: Implement proper branch-based auto-promotion strategy
🚀 **New Branching Strategy:**
- develop → triggers dev deployment → auto-promotes to staging branch
- staging → triggers staging deployment → manual approval → promotes to main branch
- main → triggers production deployment

📝 **Workflow Changes:**
- deploy-dev.yml: Now triggers on develop branch
- deploy-staging.yml: Now triggers on staging branch push
- deploy-prod.yml: Now triggers on main branch push
- auto-promote.yml: Tests dev → merges develop to staging branch
- promote-to-production.yml: Tests staging → requires approval → merges staging to main
- build-image.yml: Now builds on all branches (main, develop, staging)

🎯 **Auto-Promotion Flow:**
1. Push to develop → Deploy to dev → Test → Auto-merge to staging
2. Staging deployment → Test → Manual approval → Auto-merge to main
3. Main deployment → Production live!

This provides proper separation between environments with appropriate gates.
2025-06-30 23:18:14 -07:00
Greg
c6455bce11 Merge develop into main
- Add complete multi-environment deployment pipeline
- Add auto-promotion workflow (dev → staging → prod)
- Add smoke tests using canonical Knative domains only
- Add all Kubernetes manifests for dev/staging/prod
- Resolve LICENSE conflict using develop branch version
2025-06-30 23:13:30 -07:00
Greg
8f75e85968 fix: Remove all custom domain tests from smoke-test.yml
- Remove all tests for custom domains (2048-dev.wa.darknex.us, etc.)
- Only test canonical Knative domains now:
  - game-2048-dev.game-2048-dev.dev.wa.darknex.us
  - game-2048-staging.game-2048-staging.staging.wa.darknex.us
  - game-2048-prod.game-2048-prod.wa.darknex.us
- Simplified test structure to focus on canonical domain functionality
- Updated infrastructure tests to only check canonical domain DNS/SSL
- This should eliminate the failing custom domain tests
2025-06-30 23:09:26 -07:00
Greg
9fdcc9574a 🎯 Update all workflows to test canonical Knative domains
 Improvements:
- Prioritize canonical domain testing over custom domains
- Add fallback testing for both canonical and custom domains
- More reliable smoke tests using direct Knative service URLs
- Separate performance testing for canonical vs custom domains
- Enhanced auto-promotion pipeline with canonical domain validation

🧪 Testing Strategy:
- Primary: Test canonical domains (game-2048-*.*.wa.darknex.us)
- Secondary: Verify custom domains work via redirects
- Fallback: Test both domains in smoke tests for reliability

🔗 Canonical Domains:
- Dev: game-2048-dev.game-2048-dev.dev.wa.darknex.us
- Staging: game-2048-staging.game-2048-staging.staging.wa.darknex.us
- Prod: game-2048-prod.game-2048-prod.wa.darknex.us

This ensures tests are more reliable since canonical domains are always accessible
while custom domains may have redirect complexity.
2025-06-30 23:04:01 -07:00
Greg
3dbb1d51e8 🚀 Complete automation pipeline with SSL, testing, and deployment
 Features:
- Full SSL setup with Let's Encrypt for all environments
- Automated CI/CD pipeline with GitHub Actions
- Comprehensive smoke testing workflow
- Auto-deploy to dev on main branch push
- Manual staging/production deployments with confirmation
- Istio + nginx SSL termination architecture

🔧 Infrastructure:
- Migrated from Kourier to Istio for Knative ingress
- nginx handles SSL termination and public traffic
- Istio manages internal Knative service routing
- Scale-to-zero configuration for all environments

🧪 Testing:
- SSL certificate validation and expiry checks
- Domain accessibility and content validation
- Performance testing and redirect behavior validation
- Automated smoke tests on every deployment

🌐 Domains:
- Dev: https://2048-dev.wa.darknex.us
- Staging: https://2048-staging.wa.darknex.us
- Production: https://2048.wa.darknex.us

📦 Deployment:
- Uses latest GHCR images with imagePullPolicy: Always
- Automated secret management across namespaces
- Environment-specific Knative service configurations
- Clean manifest structure with proper labeling
2025-06-30 22:57:36 -07:00
Greg
f42d04f06e Add SSL configuration and build workflow
- Add build-image.yml workflow for automated builds to GHCR
- Add SSL certificates and domain configuration for HTTPS
- Update services to use ghcr.io/ghndrx/k8s-game-2048:latest with imagePullPolicy: Always
- Configure Kourier for SSL redirect and domain claims
- Enable HTTPS for all environments: dev, staging, prod
- Add domain mappings with TLS configuration
- Add setup-ssl.sh script for easy deployment
2025-06-30 21:29:26 -07:00
Greg
f818b22575 Add SSL configuration and build workflow
- Add build-image.yml workflow for automated builds to GHCR
- Add SSL certificates and domain configuration for HTTPS
- Update services to use ghcr.io/ghndrx/k8s-game-2048:latest with imagePullPolicy: Always
- Configure Kourier for SSL redirect and domain claims
- Enable HTTPS for all environments: dev, staging, prod
2025-06-30 21:28:26 -07:00
Greg Hendrickson
7347b89dcd Initial commit 2025-06-30 20:57:18 -07:00
greg
8322df0313 feat: add comprehensive CI/CD pipeline with auto-promotion and testing
🚀 Enhanced GitHub Actions workflows:
- Add Playwright testing to all deployment pipelines
- Implement auto-promotion from develop → staging → master
- Add visual regression testing with screenshot artifacts
- Create PR validation workflow with local testing
- Add performance testing and health checks
- Implement timestamped artifact uploads
- Add comprehensive test result reporting
- Include Kubernetes manifest validation

🧪 Testing improvements:
- Multi-browser testing (Chrome, Firefox, Safari)
- Mobile device testing (Pixel 5, iPhone 12)
- Environment-specific test validation
- Security header validation
- Health endpoint testing
- Performance benchmarking

🔄 Auto-promotion flow:
- develop → staging (automatic PR creation after tests pass)
- staging → master (automatic PR creation after tests pass)
- Manual review required for production deployment
- Full test validation at each stage
2025-06-30 20:53:20 -07:00
greg
aeccfa3717 feat: add comprehensive Playwright testing suite with visual regression
- Add Playwright configuration with multi-browser testing
- Create basic functionality tests for game mechanics
- Add gameplay tests with keyboard and touch interactions
- Implement visual regression testing with screenshots
- Add environment-specific tests for dev/staging/prod
- Include health endpoint and security header validation
- Set up test infrastructure for CI/CD pipeline
2025-06-30 20:51:05 -07:00
greg
a24c3c0d05 docs: add comprehensive branching strategy and deployment flow documentation 2025-06-30 20:46:42 -07:00
greg
29f354b835 feat: update workflows for develop/staging/master branch structure 2025-06-30 20:45:47 -07:00
greg
c3b227b7d7 Initial commit: 2048 game with Knative and Kourier deployment
- Complete 2048 game implementation with responsive design
- Knative Serving manifests for dev/staging/prod environments
- Scale-to-zero configuration with environment-specific settings
- Custom domain mapping for wa.darknex.us subdomains
- GitHub Actions workflows for CI/CD
- Docker container with nginx and health checks
- Setup scripts for Knative and Kourier installation
- GHCR integration for container registry
2025-06-30 20:43:19 -07:00