Directory Structure for Protfolio
🚀 Quick Start Guide - Bayezid Portfolio Workflows
Directory Structure
Add these files to your repository:
bayezid_portfolio/
├── .github/
│ └── workflows/
│ ├── ci-cd.yml ✅ Main CI/CD pipeline
│ ├── code-quality.yml ✅ Code quality checks
│ └── deploy.yml ✅ Deployment workflows
├── Dockerfile ✅ Docker build config
├── docker-compose.yml ✅ Local dev environment
├── nginx.conf ✅ Reverse proxy config
├── .dockerignore ✅ Docker ignore file
├── GITHUB_ACTIONS_SETUP.md ✅ Setup instructions
└── WORKFLOWS_README.md ✅ This file
Step 1: Copy Workflow Files
mkdir -p .github/workflows
Copy these files:
ci-cd.yml→.github/workflows/ci-cd.ymlcode-quality.yml→.github/workflows/code-quality.ymldeploy.yml→.github/workflows/deploy.yml
Copy these files to repository root:
Dockerfiledocker-compose.ymlnginx.conf.dockerignore
Step 2: Configure Secrets
Follow the detailed guide in GITHUB_ACTIONS_SETUP.md:
- Generate SSH keys
- Configure server access
- Add GitHub secrets
- Set up environments
Step 3: Verify Installation
# Test locally
docker-compose up --build
# Visit: http://localhost:3000
curl http://localhost:3000
Step 4: Push to GitHub
git add .github/ Dockerfile docker-compose.yml nginx.conf .dockerignore
git commit -m "ci: add GitHub Actions workflows"
git push origin main
📊 Workflow Status
Check status at: https://github.com/your-username/bayezid_portfolio/actions
🔄 What Each Workflow Does
CI/CD Pipeline (ci-cd.yml)
✅ Runs on every push and PR
✅ Type checking (TypeScript)
✅ Code formatting validation
✅ Security scanning
✅ Build verification
✅ Auto-deploy to staging/production
✅ Health checks
✅ Performance reporting
Code Quality (code-quality.yml)
✅ Prettier formatting
✅ TypeScript strict checks
✅ Dependency audits
✅ Build verification
✅ Lighthouse performance
Deploy (deploy.yml)
✅ Docker image building
✅ SSH deployment
✅ Health checks
✅ Smoke tests
✅ Automatic rollback on failure
✅ Deployment notifications
🎯 Key Features
Automated Testing
- Type checking
- Code formatting
- Dependency scanning
- Build verification
Automated Deployment
- Staging (on develop branch)
- Production (on main branch)
- Manual deployment option
- Automatic rollback
Quality Gates
- All checks must pass before merge
- PR comments with feedback
- Performance reports
- Security scanning
Notifications
- PR comments on failures
- Deployment status
- Build artifacts
- Performance metrics
🔐 Environment Variables
Add to .env file (never commit):
NODE_ENV=production
PORT=3000
# Add your API keys and configs here
📝 Branch Protection Rules
Go to: Settings > Branches > Branch protection rules
For main branch:
✅ Require status checks to pass
✅ Require code reviews before merge
✅ Include administrators
✅ Dismiss stale PR approvals
🚨 Troubleshooting
Workflows not running?
- Check
.github/workflows/directory exists - Verify file names match exactly
- Check YAML syntax (use https://www.yamllint.com/)
Deployment failing?
- Check SSH keys in secrets
- Verify server is accessible
- Check deployment path exists
- Review server logs
Build failing?
- Run locally:
pnpm install && pnpm build - Check Node version:
node -v(should be 20+) - Check pnpm version:
pnpm -v(should be 10.4.1+)
📚 Next Steps
- ✅ Copy workflow files
- ✅ Configure secrets
- ✅ Test locally with Docker
- ✅ Push to GitHub
- ✅ Monitor first deployment
- ✅ Set up branch protection
- ✅ Document deployment process
🔗 Useful Links
✨ Pro Tips
Local Testing: Use
actto test workflows locallynpm install -g act act -l # List workflows act # Run workflowsDebug Mode: Add to workflow:
- name: Debug run: | echo "Branch: ${{ github.ref }}" echo "Commit: ${{ github.sha }}" env | grep -i githubCaching: Workflows cache dependencies for faster builds
Parallel Jobs: Most jobs run in parallel for speed
Status Badges: Add to README:
 
Need help? Check GITHUB_ACTIONS_SETUP.md for detailed instructions.