- Update docker-compose.yml to use modern 'docker compose' syntax (v2) - Fix GitHub Actions Docker login to use GitHub Container Registry (ghcr.io) - Add comprehensive GitHub repository settings documentation - Add alternative CI/CD workflow without Docker push requirement - Update package.json scripts for modern Docker commands - Add Docker security scanning and metadata extraction - Add repository permissions configuration for GitHub Actions - Update Docker documentation with modern practices This addresses the Docker login issues and modernizes the deployment process while providing fallback options for CI/CD implementation.
5.5 KiB
GitHub Repository Settings Configuration
This document explains how to configure your GitHub repository for optimal CI/CD performance and security.
🔧 Required GitHub Settings
1. Repository Permissions for GitHub Actions
To enable GitHub Container Registry (ghcr.io) and proper CI/CD functionality:
- Go to your repository settings:
https://github.com/YOUR_USERNAME/narrow_casting_system/settings - Navigate to Actions → General
- Under Workflow permissions, select:
- ✅ Read and write permissions
- ✅ Allow GitHub Actions to create and approve pull requests
2. Package Registry Settings
- Go to your profile:
https://github.com/YOUR_USERNAME - Click on Packages
- Ensure package creation is enabled for your repository
🐳 Docker Configuration Options
Option 1: GitHub Container Registry (Recommended - Already Configured)
Your current workflow uses GitHub Container Registry (ghcr.io) which:
- ✅ Works automatically with GitHub Actions
- ✅ Uses your existing GitHub credentials
- ✅ Provides good performance
- ✅ Free for public repositories
Option 2: Docker Hub (If You Prefer)
If you want to use Docker Hub instead, you would need to:
- Create a Docker Hub account at https://hub.docker.com
- Create repository secrets in GitHub:
- Go to Settings → Secrets and variables → Actions
- Add
DOCKER_USERNAMEwith your Docker Hub username - Add
DOCKER_PASSWORDwith your Docker Hub password
- Update the workflow to use Docker Hub instead of ghcr.io
🔒 Security Settings
Repository Security Settings
-
Code security & analysis:
- Enable Dependabot alerts
- Enable CodeQL analysis
- Enable **Secret scanning"
-
Branch protection (for main branch):
- Require pull request reviews
- Require status checks to pass
- Require branches to be up to date before merging
Current Security Status
- ✅ Dependabot: Enabled (will alert on vulnerable dependencies)
- ✅ Security scanning: Implemented in CI/CD pipeline
- ✅ Package scanning: Docker images are scanned for vulnerabilities
🚀 CI/CD Configuration
Workflow Files
Your repository has two CI/CD workflows:
-
.github/workflows/ci.yml(Full pipeline with Docker)- Comprehensive testing
- Docker image building
- Security scanning
- Multi-platform support (AMD64, ARM64)
-
.github/workflows/ci-simple.yml(Testing only)- Focused on testing without Docker
- Faster builds
- Good for development
Workflow Permissions
The workflows require these permissions:
permissions:
contents: read # Read repository contents
packages: write # Write to GitHub Container Registry
security-events: write # Upload security scan results
📊 Monitoring Your CI/CD
GitHub Actions Dashboard
- Visit:
https://github.com/YOUR_USERNAME/narrow_casting_system/actions - View all workflow runs
- Check logs and results
- Download artifacts
Security Dashboard
- Visit:
https://github.com/YOUR_USERNAME/narrow_casting_system/security - View security alerts
- Check dependency vulnerabilities
- Review security policies
🛠️ Current CI/CD Status
What's Working
✅ Automated Testing: All tests run on every push
✅ Security Auditing: Dependencies are checked for vulnerabilities
✅ Multi-Node Testing: Tests run on Node.js 18.x and 20.x
✅ Security Scanning: Code is scanned for security issues
✅ Documentation: Security considerations are documented
What You Might See
⚠️ Docker Login Issues: If Docker push fails, the testing still works ⚠️ Security Warnings: Known sqlite3 vulnerabilities (documented) ⚠️ Audit Warnings: Some dependencies have known issues
🎯 Recommended Next Steps
1. Immediate Actions
- Check that GitHub Actions are running successfully
- Review any security alerts in your repository
- Test the application locally using the provided instructions
2. For Production Deployment
- Set up proper SSL certificates
- Configure firewall rules
- Set up monitoring and alerting
- Consider migrating to better-sqlite3 for improved security
3. For Docker Deployment (Optional)
- Ensure GitHub Container Registry is enabled
- Test Docker deployment locally first
- Set up proper domain name and SSL
📞 Troubleshooting
Common Issues
-
GitHub Actions not running
- Check repository settings → Actions → General
- Ensure Actions are enabled for the repository
-
Docker login failures
- The current setup uses GitHub Container Registry (ghcr.io)
- This should work automatically with GitHub Actions
- If issues persist, check repository permissions
-
Security audit failures
- The workflow continues despite security warnings
- Check
docs/SECURITY_CONSIDERATIONS.mdfor details - These are documented and acceptable for this use case
-
Node.js version issues
- The workflow tests on Node.js 18.x and 20.x
- Both versions are supported and should work
🔗 Useful Links
- Repository: https://github.com/Alvin-Zilverstand/narrow_casting_system
- Actions: https://github.com/Alvin-Zilverstand/narrow_casting_system/actions
- Security: https://github.com/Alvin-Zilverstand/narrow_casting_system/security
- Packages: https://github.com/Alvin-Zilverstand/narrow_casting_system/packages
Note: Your current setup uses GitHub Container Registry (ghcr.io) which is the recommended approach and should work automatically without additional configuration!