GitHub Setup
GitHub Repository Setup Guide
This guide walks you through setting up your GitHub repository with best practices, including branch protection, GitHub Pages, and automated Docker image publishing.
Initial Repository Setup
1. Create Repository on GitHub
# If you haven't already, create a new repository on GitHub
# Then push your local code:
git remote add origin https://github.com/obermarclp/the-nom-database.git
git branch -M main
git push -u origin main2. Create Develop Branch
# Create and push develop branch
git checkout -b develop
git push -u origin develop
# Set develop as default branch in GitHub Settings (optional but recommended)Branch Protection Rules
Setting Up Branch Protection
- Go to Settings → Branches → Add branch protection rule
Protection for main Branch
Branch name pattern: main
Settings:
✅ Require a pull request before merging
- ✅ Require approvals: 1
- ✅ Dismiss stale pull request approvals when new commits are pushed
- ✅ Require review from Code Owners (if you have CODEOWNERS file)
✅ Require status checks to pass before merging
- ✅ Require branches to be up to date before merging
- Required checks:
test-backendtest-frontendsecurity-scanbuild-and-push / build-and-push (backend)build-and-push / build-and-push (frontend)
✅ Require conversation resolution before merging
✅ Require signed commits (optional but recommended)
✅ Require linear history (optional)
✅ Do not allow bypassing the above settings
❌ Allow force pushes (disabled)
❌ Allow deletions (disabled)
Protection for develop Branch
Branch name pattern: develop
Settings:
✅ Require a pull request before merging
- ✅ Require approvals: 1
✅ Require status checks to pass before merging
- Required checks:
test-backendtest-frontend
- Required checks:
✅ Require conversation resolution before merging
⚠️ Allow force pushes
- Only for administrators (for occasional rebasing)
❌ Allow deletions (disabled)
GitHub Pages Setup
Enable GitHub Pages
Go to Settings → Pages
Source:
- Select: GitHub Actions
The workflow
.github/workflows/pages.ymlwill automatically deploy docsCustom domain (optional):
- Add your custom domain
- Configure DNS with CNAME record
Enforce HTTPS: ✅ Enabled
Verify Deployment
After pushing to main:
- Check Actions tab for “Deploy GitHub Pages” workflow
- Visit:
https://obermarclp.github.io/the-nom-database
GitHub Container Registry Setup
Enable Packages
GitHub Packages is automatically enabled. Docker images will be published to:
ghcr.io/obermarclp/the-nom-database/backendghcr.io/obermarclp/the-nom-database/frontend
Make Images Public (Recommended)
- Go to Packages (from your profile or repository)
- Click on
backendpackage - Package settings → Change visibility → Public
- Repeat for
frontendpackage
Pull Images Without Authentication
Once public, anyone can pull:
docker pull ghcr.io/obermarclp/the-nom-database/backend:latest
docker pull ghcr.io/obermarclp/the-nom-database/frontend:latestRepository Settings
General Settings
Go to Settings → General
Features:
- ✅ Wikis (if you want a wiki)
- ✅ Issues
- ✅ Sponsorships (optional)
- ✅ Preserve this repository (for archiving)
- ✅ Discussions (recommended for community)
Pull Requests:
- ✅ Allow squash merging
- ✅ Allow merge commits
- ✅ Allow rebase merging
- ✅ Always suggest updating pull request branches
- ✅ Allow auto-merge
- ✅ Automatically delete head branches
Merge button:
- Default to: Squash and merge
Security Settings
Go to Settings → Code security and analysis
Dependency graph: ✅ Enabled
Dependabot:
- ✅ Dependabot alerts
- ✅ Dependabot security updates
Code scanning:
- ✅ CodeQL analysis (optional)
Secret scanning:
- ✅ Enabled (automatically for public repos)
Actions Settings
Go to Settings → Actions → General
Actions permissions:
- ✅ Allow all actions and reusable workflows
Workflow permissions:
- ✅ Read and write permissions
- ✅ Allow GitHub Actions to create and approve pull requests
Fork pull request workflows:
- ⚠️ Require approval for first-time contributors
Environment Secrets
Add Repository Secrets
Go to Settings → Secrets and variables → Actions → New repository secret
Optional secrets for CI/CD:
CODECOV_TOKEN- For code coverage reportingVITE_API_URL- Production API URL for frontend build
Note: GITHUB_TOKEN is automatically provided by GitHub Actions.
Repository Labels
Create Custom Labels
Go to Issues → Labels → New label
Recommended labels:
Type:
type: feature- New features (color: #0075ca)type: bug- Bug fixes (color: #d73a4a)type: docs- Documentation (color: #0075ca)type: refactor- Code refactoring (color: #fbca04)type: test- Testing (color: #0e8a16)
Priority:
priority: high- High priority (color: #d93f0b)priority: medium- Medium priority (color: #fbca04)priority: low- Low priority (color: #0e8a16)
Status:
status: needs review- Needs review (color: #fbca04)status: in progress- In progress (color: #0075ca)status: blocked- Blocked (color: #d93f0b)
Other:
good first issue- Good for newcomers (color: #7057ff)help wanted- Need help (color: #008672)breaking change- Breaking changes (color: #d93f0b)security- Security related (color: #d93f0b)
Issue Templates
Create .github/ISSUE_TEMPLATE/ directory with templates:
Bug Report Template
Create .github/ISSUE_TEMPLATE/bug_report.md:
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: 'type: bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.Feature Request Template
Create .github/ISSUE_TEMPLATE/feature_request.md:
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'type: feature'
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.Pull Request Template
Create .github/PULL_REQUEST_TEMPLATE.md:
## Description
Brief description of changes.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Related Issues
Fixes #(issue number)
## How Has This Been Tested?
Please describe the tests you ran.
- [ ] Test A
- [ ] Test B
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and publishedRelease Management
Creating Your First Release
# Make sure you're on main branch
git checkout main
git pull origin main
# Create a tag
git tag -a v1.0.0 -m "Initial release v1.0.0"
# Push tag (this triggers release workflow)
git push origin v1.0.0GitHub Actions will automatically:
- ✅ Build Docker images for linux/amd64 and linux/arm64
- ✅ Publish images to GitHub Container Registry
- ✅ Create GitHub Release with changelog
- ✅ Build platform-specific binaries
- ✅ Upload binaries to release
Release Page
Visit: https://github.com/obermarclp/the-nom-database/releases
Webhooks (Optional)
Discord Notifications
- Create webhook in Discord server
- Go to Settings → Webhooks → Add webhook
- Payload URL: Your Discord webhook URL
- Content type: application/json
- Events: Select what to notify
Slack Notifications
Similar to Discord, integrate with Slack workspace.
Repository Insights
Enable Insights
- Go to Insights tab
- Useful views:
- Pulse - Activity overview
- Contributors - Contribution stats
- Traffic - Views and clones
- Dependency graph - Dependencies
- Network - Forks and branches
Community Health Files
Create these files in repository root:
CODE_OF_CONDUCT.md
Define community standards and behavior.
SECURITY.md
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
| < 1.0 | :x: |
## Reporting a Vulnerability
Please report security vulnerabilities to security@yourdomain.com or via GitHub Security Advisories.
**Do not** open public issues for security vulnerabilities.CODEOWNERS (Optional)
Create .github/CODEOWNERS:
# Default owners
* @obermarclp
# Backend code
/backend/ @backend-team
# Frontend code
/frontend/ @frontend-team
# Documentation
/docs/ @docs-team
# CI/CD
/.github/ @devops-teamVerification Checklist
After setup, verify:
- Repository created and code pushed
-
mainanddevelopbranches exist - Branch protection rules configured
- GitHub Pages deployed
- Actions tab shows successful workflows
- Docker images published to ghcr.io
- Images are public (if intended)
- Issue/PR templates working
- Labels created
- First release tagged
- Documentation accessible
Maintenance
Regular Tasks
Weekly:
- Review and merge Dependabot PRs
- Triage new issues
- Review open PRs
Monthly:
- Check GitHub Actions usage/costs
- Review security alerts
- Update documentation
Quarterly:
- Audit branch protection rules
- Review and clean up stale branches
- Analyze repository insights
Troubleshooting
GitHub Actions Failing
- Check Actions tab for error logs
- Verify secrets are set correctly
- Check branch protection status checks
Docker Images Not Publishing
- Verify workflow permissions (Settings → Actions)
- Check if images are set to public
- Verify GITHUB_TOKEN permissions
GitHub Pages Not Deploying
- Check Pages workflow in Actions
- Verify Pages is enabled in Settings
- Check for Jekyll build errors
Additional Resources
Support
For repository setup questions:
- Open a Discussion
- Contact repository maintainers
- Check GitHub Documentation
Next Steps: Once setup is complete, see Git Workflow for daily development workflows.