This guide provides step-by-step instructions for setting up and configuring this repository, including GitHub Pages, security features, and branch protection.
- GitHub Pages Setup
- Repository Settings
- Branch Protection
- Security Configuration
- CI/CD Setup
- Troubleshooting
Problem: The landing page and live demo show 404 errors.
Root Cause: GitHub Pages needs to be:
- Enabled in repository settings
- Configured to serve from the correct branch and folder
- All changes need to be merged to the main branch
First, ensure all changes are merged to the main branch:
# If you're on a feature branch, create a PR and merge it
# Or, if you have permissions:
git checkout main
git merge copilot/add-ai-testing-concepts
git push origin main-
Navigate to Repository Settings
- Go to your GitHub repository
- Click Settings tab (top right)
-
Find Pages Section
- Scroll down the left sidebar
- Click Pages under "Code and automation"
-
Configure Source
- Source: Select "Deploy from a branch"
- Branch: Select
main - Folder: Select
/docs - Click Save
-
Wait for Deployment
- GitHub Pages takes 1-5 minutes to deploy
- A green checkmark will appear when ready
- Your site URL will be displayed
After deployment, your sites will be available at:
- Landing Page:
https://bg-playground.github.io/Microsoft-Test-Demo-01/ - Live Demo:
https://bg-playground.github.io/Microsoft-Test-Demo-01/src/
If you prefer automated deployment:
- Use the GitHub Pages action
- Configure workflow to deploy on push to main
- See
.github/workflows/for examples
Navigate to Settings → General:
- ✅ Issues: Enable for bug tracking
- ✅ Projects: Enable for project management
- ✅ Discussions: Optional, for community engagement
- ✅ Wiki: Optional, for additional documentation
- ✅ Allow merge commits: Enable
- ✅ Allow squash merging: Enable (recommended)
- ✅ Allow rebase merging: Enable
- ✅ Always suggest updating pull request branches: Enable
- ✅ Automatically delete head branches: Enable
- ✅ Include Git LFS objects: If using LFS
Navigate to Settings → Branches → Add branch protection rule
Branch name pattern: main
-
✅ Require a pull request before merging
- ✅ Require approvals: 1 (or more for teams)
- ✅ Dismiss stale pull request approvals when new commits are pushed
- ✅ Require review from Code Owners (if CODEOWNERS file exists)
-
✅ Require status checks to pass before merging
- ✅ Require branches to be up to date before merging
- Select required checks:
Playwright Tests(from GitHub Actions)CodeQL(if enabled)
-
✅ Require conversation resolution before merging
-
✅ Require signed commits (recommended for enhanced security)
-
✅ Require linear history (optional, prevents merge commits)
-
✅ Include administrators (optional, applies rules to admins too)
- ✅ Allow force pushes: ❌ Disable
- ✅ Allow deletions: ❌ Disable
Branch Protection Rules for 'main':
├── Require pull request reviews
│ ├── Required approvals: 1
│ └── Dismiss stale reviews: Yes
├── Require status checks
│ ├── Playwright Tests: Required
│ └── Branch must be up to date: Yes
├── Require conversation resolution: Yes
├── Require signed commits: Yes (recommended)
└── Restrictions
├── Force pushes: Disabled
└── Deletions: DisabledNavigate to Settings → Security
-
Dependabot alerts
- ✅ Enable: Alerts for vulnerable dependencies
-
Dependabot security updates
- ✅ Enable: Automatic PRs for security updates
-
Dependabot version updates
- ✅ Enable: Automatic PRs for version updates
- Create
.github/dependabot.yml:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
reviewers:
- "your-github-username"-
CodeQL Analysis
- ✅ Enable: Automated code scanning
- It's already configured in
.github/workflows/
-
Secret Scanning
- ✅ Enable: Detects committed secrets
- Available for public repositories by default
- ✅
SECURITY.mdfile already created - Defines vulnerability reporting process
Navigate to Settings → Security → Reporting
- ✅ Enable: Allows private security reports
- Advisories can be published after fixes
Your repository already has GitHub Actions configured:
- File:
.github/workflows/playwright.yml - Triggers: Push to main, Pull requests
- Jobs: Install, test, report
- Go to Actions tab
- Check recent workflow runs
- Ensure tests are passing
- Review artifacts (test reports)
Currently, no secrets are required. If adding:
- Settings → Secrets and variables → Actions
- Add repository secrets
- Reference in workflows:
${{ secrets.SECRET_NAME }}
Problem: Pages show 404 errors
Solutions:
-
Check Branch
# Ensure changes are on main git checkout main git pull origin main -
Verify Settings
- Settings → Pages → Source must be
mainbranch,/docsfolder
- Settings → Pages → Source must be
-
Check File Paths
docs/index.htmlmust exist- Files must be in
docs/directory
-
Wait for Deployment
- Takes 1-5 minutes after pushing
- Check Actions tab for deployment status
-
Clear Browser Cache
- Hard refresh: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
Problem: GitHub Actions failing
Solutions:
-
Check Logs
- Actions tab → Failed workflow → View logs
-
Common Issues:
- Node version mismatch: Update in workflow
- Missing dependencies: Run
npm install - Test failures: Fix failing tests
-
Local Testing:
npm install npx playwright install npm test
Problem: Cannot push to main
Expected: Branch protection is working correctly!
Solution: Use pull requests:
git checkout -b feature/my-feature
# Make changes
git push origin feature/my-feature
# Create PR on GitHubmain (protected)
├── feature/landing-page
├── feature/new-tests
└── fix/bug-123
-
Main Branch
- Always deployable
- Protected, no direct pushes
- Merge only via PRs
-
Feature Branches
- Named:
feature/description - Created from main
- Merged via PR
- Named:
-
Fix Branches
- Named:
fix/description - For bug fixes
- Merged via PR
- Named:
-
Release Strategy
- Tag releases:
v1.0.0 - Create releases on GitHub
- Document changes in release notes
- Tag releases:
After completing setup:
- GitHub Pages enabled and working
- Branch protection on main configured
- Dependabot alerts enabled
- CodeQL scanning active
- Secret scanning enabled
- CI/CD workflow passing
- Repository settings configured
- SECURITY.md reviewed
- Team members added (if applicable)
- README badges updated
- Review Dependabot PRs
- Check security alerts
- Monitor CI/CD status
- Review and update dependencies
- Audit security settings
- Review branch protection rules
- Update documentation
- Security audit
- Performance review
- Documentation refresh
- Dependency major version updates
- GitHub Pages Documentation
- Branch Protection Rules
- GitHub Actions Documentation
- Dependabot Documentation
- CodeQL Documentation
For issues or questions:
- Create an issue in the repository
- Review existing documentation
- Check troubleshooting section above
Last Updated: February 2024
Version: 1.0